Uh oh!
There was an error while loading. Please reload this page.
src: move package_json_reader cache to c++ - #50322
Conversation
nodejs-github-bot
commented
Oct 21, 2023
Review requested:
|
e462554 to
ba0be9bCompare5158e35 to
2690c64CompareUh oh!
There was an error while loading. Please reload this page.
2bfbcdb to
8309e95CompareRafaelGSS
commented
Nov 29, 2023
@anonrig See #50954 (review). |
RafaelGSS
commented
Nov 29, 2023
Adding dont-land labels again. |
anonrig
commented
Dec 4, 2023
The mentioned issue is fixed in #50965 |
RafaelGSS
commented
Dec 15, 2023
Applying
semver-minor |
@anonrig I would like to land this on v20 but its not landing cleanly, can you backport? |
BridgeAR
commented
May 2, 2025
@anonrig this seems to cause a major performance regression. I did not look deeper into this but it's causing test code to run about 10x slower when running the following example code: DataDog/dd-trace-js#5360 |
@BridgeAR Happy to take a look. Can you share a reproduction that doesn't require any external knowledge, and open a new issue and tag me? |
BridgeAR
commented
May 2, 2025
I can't look into it closer at the moment. Since about 80% of all time is taken in Node.js when running the example, I guess it should be fine to check the source code to cause the problem. I'll open a issue about it though. |
Co-authored by @lemire
Local Benchmark
My local benchmarks says that running
vite --versionis 5% fasterTODOs
node_modules.ccnode_modules.ccsnapshottablegetPackageScopeConfigfrompackage_config.jsto C++ side, and cache it onnode_modules.ccCaveats
ERR_INVALID_PACKAGE_CONFIGdoes not include JSON.Parse() error message anymore. This mainly because we're usingsimdjsonto avoid JS allocation while parsing for performance reasons.ERR_INVALID_PACKAGE_CONFIGinstead of returning an invalid value.Benchmarks