Optimize node_modules indexing

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.

Environment

None

Attachments

1

Activity

Show:

Mike Fikes May 6, 2018 at 11:06 PM

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

Juho Teperi April 17, 2018 at 4:38 PM

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

Completed

Details

Assignee

Reporter

Labels

Patch

Code

Affects versions

Priority

Created April 17, 2018 at 3:09 PM
Updated May 7, 2018 at 9:29 PM
Resolved May 7, 2018 at 9:29 PM