[BUG] Performance issue installing packages with large number of Folders #7080
Labels
Bug
thing that needs fixing
Needs Triage
needs review for next steps
Release 9.x
work is associated with a specific npm 9 release
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
We have a large package (~75K files) that is taking a long time to install (1-2 minutes). I was able to debug this issue more thoroughly and have discovered an interesting performance nuance for packages with a large number of folders. It seems that folders create ~10x slow-down installing than a comparative package of the same size but with a flat structure.
Expected Behavior
I would expect that a flat or nested file structure to have roughly the same performance profile when unpacking and installing.
Steps To Reproduce
I created two versions of a dummy package (
@bigtimebuddy-dev/install-stress-test
):./dist/*.txt
)./dist/*/*/*/*.txt
)Time results with v1.2.0
Time results with v1.3.0
Full Reproduction Steps
Environment
The text was updated successfully, but these errors were encountered: