Conversation
Reuse project state and carry pre-resolved npm metadata into install to avoid duplicate add-time resolver work. Keep the new packument cache scoped to the add path so cold installs stay unchanged.
⏱️ Benchmark Resultsgatsby install-full-cold
📊 Raw benchmark data (gatsby install-full-cold)Base times: 2.803s, 2.835s, 2.803s, 2.761s, 2.813s, 2.823s, 2.779s, 2.782s, 2.775s, 2.827s, 2.839s, 2.847s, 2.800s, 2.802s, 2.787s, 2.811s, 2.789s, 2.790s, 2.845s, 2.853s, 2.828s, 2.803s, 2.818s, 2.818s, 2.815s, 2.807s, 2.782s, 2.774s, 2.801s, 2.774s Head times: 2.993s, 2.758s, 2.873s, 2.838s, 2.838s, 2.835s, 2.839s, 2.801s, 2.825s, 2.831s, 2.825s, 2.799s, 2.814s, 2.815s, 2.827s, 2.788s, 2.799s, 2.810s, 2.805s, 2.806s, 2.787s, 2.841s, 2.815s, 2.807s, 2.820s, 2.805s, 2.807s, 2.789s, 2.872s, 2.774s gatsby install-cache-and-lock (warm, with lockfile)
📊 Raw benchmark data (gatsby install-cache-and-lock (warm, with lockfile))Base times: 0.405s, 0.420s, 0.422s, 0.415s, 0.406s, 0.402s, 0.410s, 0.405s, 0.417s, 0.414s, 0.403s, 0.403s, 0.413s, 0.407s, 0.404s, 0.406s, 0.412s, 0.413s, 0.406s, 0.414s, 0.413s, 0.425s, 0.402s, 0.398s, 0.406s, 0.405s, 0.409s, 0.412s, 0.402s, 0.399s Head times: 0.416s, 0.411s, 0.409s, 0.408s, 0.416s, 0.418s, 0.421s, 0.425s, 0.419s, 0.420s, 0.411s, 0.415s, 0.417s, 0.414s, 0.410s, 0.419s, 0.410s, 0.416s, 0.416s, 0.420s, 0.416s, 0.413s, 0.419s, 0.419s, 0.418s, 0.426s, 0.421s, 0.416s, 0.419s, 0.414s |
|
I think before this optimization I'd be interested we first try to implement the metadata cache originally implemented for Berry in yarnpkg/berry#5491 (also a nit, we don't use the term "packument", we use "metadata"). |
Reuse project state and carry pre-resolved npm metadata into install to avoid duplicate add-time resolver work. Keep the new packument cache scoped to the add path so cold installs stay unchanged.
Benchmark
All benchmarks were run locally on macOS with release binaries.
Warm repeated
add kleurThis benchmark measures a warm repeated
add kleurpath by removingkleurbefore each iteration.Baseline binary:
/tmp/zpm-base-bench/target/release/yarn-binPatched binary:
/Users/nemurubaka/repos/zpm/target/release/yarn-binResults: