ClojureScript

Optimize node_modules indexing

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: 1.10.238
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Patch:
    Code

Description

Indexing node_modules can take quite a while. As an example, with the node_modules directory that is set up for React Native projects, on a 2012 Mac Pro, this can take about 45 seconds. This is long enough where, if node_modules isn't actually being used for ClojureScript, using :npm-deps false is highly motivated.

If there was a way to make this closer to instantaneous (perhaps via caching or other clever approaches), then this would benefit all users.

Activity

Hide
Juho Teperi added a comment -

Based on Mike's test this is mostly caused by index-node-modules-dir, which reads the node modules dir tree using JVM: https://gist.github.com/mfikes/c99cfac7b9f5ae48fc9644bbde492a3c

Show
Juho Teperi added a comment - Based on Mike's test this is mostly caused by index-node-modules-dir, which reads the node modules dir tree using JVM: https://gist.github.com/mfikes/c99cfac7b9f5ae48fc9644bbde492a3c
Hide
Mike Fikes added a comment -

For one of my projects the attached patch drops the time spent in index-node-modules-dir from 30 seconds to 5 seconds.

Show
Mike Fikes added a comment - For one of my projects the attached patch drops the time spent in index-node-modules-dir from 30 seconds to 5 seconds.

People

Vote (5)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: