perf: use a dict for linked package store directory membership checks#2908
Conversation
dzbarsky
left a comment
There was a problem hiding this comment.
Did you actually measure a win? I feel like linear scan is usually faster than dict for up to 10ish elements so this might be a loss in aggregate
I can investigate this specific one more and try both. |
2770b7a to
eb79a6e
Compare
A robot says:
|
eb79a6e to
292a834
Compare
The 'not in' check against a list is O(direct deps) for each entry in the transitive npm_package_store_infos of the package, making the linking loop quadratic for packages with many deps.
292a834 to
452dfa0
Compare
The 'not in' check against a list is O(direct deps) for each entry in the transitive npm_package_store_infos of the package, making the linking loop quadratic for packages with many deps.
Changes are visible to end-users:no
Test plan