Repository navigation
perf(cli): reduce managed runtime shim startup overhead - #13739
Conversation
📝 WalkthroughWalkthroughThe PR adds a validated runtime launcher cache for managed runtime shims. It also changes ELF libc detection to use bounded streaming reads and adds tests for cache integrity, security, concurrency, and bounded ELF parsing. ChangesRuntime shim and libc detection
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ShimDispatcher
participant RuntimeLauncherCache
participant RuntimeMaterializer
participant RuntimeBinary
ShimDispatcher->>RuntimeLauncherCache: Look up runtime launcher
RuntimeLauncherCache-->>ShimDispatcher: Return validated cached path
ShimDispatcher->>RuntimeBinary: Execute cached binary
ShimDispatcher->>RuntimeMaterializer: Materialize on cache miss
RuntimeMaterializer-->>ShimDispatcher: Return executable and publish launcher
Possibly related PRs
Suggested labels: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (2): Last reviewed commit: "fix(cli): keep managed runtime configura..." | Re-trigger Greptile |
PR Summary by Qodoperf(cli): reduce managed runtime shim startup overhead
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
pnpm/crates/cli/src/shim_dispatch/runtime_env/tests.rs (2)
126-127: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMake the oversized case prove the size limit.
vec![b'x'; MAX_RUNTIME_LAUNCHER_SIZE + 1]is not valid JSON. The assertion therefore still passes if theMAX_RUNTIME_LAUNCHER_SIZEguard inread_runtime_launcheris removed, so the test does not prove the bound. Pad a valid launcher record past the limit instead. JSON tolerates trailing whitespace, so the padded record deserializes only if the size guard is missing.💚 Proposed test change
- fs::write(path, vec![b'x'; MAX_RUNTIME_LAUNCHER_SIZE as usize + 1]).unwrap(); + fixture.write_launcher("node", "22.11.0"); + let mut oversized = fs::read(&path).unwrap(); + oversized.resize(MAX_RUNTIME_LAUNCHER_SIZE as usize + 1, b' '); + fs::write(path, oversized).unwrap(); assert_eq!(cached_runtime_bin_at(&fixture.environments_dir, "node", "22.11.0"), None);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/src/shim_dispatch/runtime_env/tests.rs` around lines 126 - 127, Update the oversized fixture in the test covering cached_runtime_bin_at so it starts with a valid JSON launcher record and then appends enough trailing whitespace to exceed MAX_RUNTIME_LAUNCHER_SIZE. Keep the existing None assertion, ensuring the record would deserialize successfully if read_runtime_launcher did not enforce the size limit.Source: Path instructions
130-174: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse visible platform ignores instead of
#[cfg(unix)].
#[cfg(unix)]removes these three tests from the Windows test report, so the skip is invisible. CONTRIBUTING.md requires visiblecfg_attr(..., ignore)gates for platform-specific tests. This matters most forsymlinked_launcher_is_never_followed, becauseread_runtime_launcherhas a Windows-onlyFILE_FLAG_OPEN_REPARSE_POINTbranch that no reported test covers.
std::os::unix::fs::symlinkdoes not compile on Windows, so switch the symlink calls to the portablepacquet_fshelpers that the fixture already uses, then gate with#[cfg_attr(windows, ignore = "...")].🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/src/shim_dispatch/runtime_env/tests.rs` around lines 130 - 174, Replace the #[cfg(unix)] gates on symlinked_launcher_is_never_followed, launcher_never_executes_a_package_outside_its_store, and launcher_never_executes_a_manifest_bin_outside_its_package with visible #[cfg_attr(windows, ignore = "...")] gates. Replace each std::os::unix::fs::symlink call with the portable pacquet_fs symlink helper already used by RuntimeFixture so the tests compile and report as ignored on Windows.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/cli/src/shim_dispatch/runtime_env.rs`:
- Around line 70-83: Update read_runtime_launcher to include the Unix O_NONBLOCK
flag in the existing OpenOptions custom_flags configuration, alongside
O_NOFOLLOW, so opening a FIFO cannot block before the metadata.is_file()
validation and non-regular launchers fall back as cache misses.
---
Nitpick comments:
In `@pnpm/crates/cli/src/shim_dispatch/runtime_env/tests.rs`:
- Around line 126-127: Update the oversized fixture in the test covering
cached_runtime_bin_at so it starts with a valid JSON launcher record and then
appends enough trailing whitespace to exceed MAX_RUNTIME_LAUNCHER_SIZE. Keep the
existing None assertion, ensuring the record would deserialize successfully if
read_runtime_launcher did not enforce the size limit.
- Around line 130-174: Replace the #[cfg(unix)] gates on
symlinked_launcher_is_never_followed,
launcher_never_executes_a_package_outside_its_store, and
launcher_never_executes_a_manifest_bin_outside_its_package with visible
#[cfg_attr(windows, ignore = "...")] gates. Replace each
std::os::unix::fs::symlink call with the portable pacquet_fs symlink helper
already used by RuntimeFixture so the tests compile and report as ignored on
Windows.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 2263690f-cf96-42d3-bad4-9a160f002c27
📒 Files selected for processing (6)
.changeset/faster-global-runtime-shims.mdpnpm/crates/cli/src/shim_dispatch.rspnpm/crates/cli/src/shim_dispatch/runtime_env.rspnpm/crates/cli/src/shim_dispatch/runtime_env/tests.rspnpm/crates/detect-libc/src/elf.rspnpm/crates/detect-libc/src/elf/tests.rs
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13739 +/- ##
=======================================
Coverage 88.09% 88.09%
=======================================
Files 621 621
Lines 101071 101075 +4
=======================================
+ Hits 89039 89047 +8
+ Misses 12032 12028 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code Review by Qodo
1.
|
Micro-Benchmark ResultsLinux |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Follow-up commit 052cf62 addresses the review and CI findings:
Validation: 43 libc tests, 29 dispatcher tests, the runtime download integration test, Windows-target compilation, all 7,896 Rust tests, workspace clippy, dylint, and the complete pre-push gate pass locally. Written by an agent (Codex, GPT-5.6). |
Integrated-Benchmark Report (Linux)Commit: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.47291806234,
"stddev": 0.158646758487791,
"median": 2.4148030032400003,
"user": 1.4988935599999997,
"system": 1.316259,
"min": 2.34777492924,
"max": 2.79045389824,
"times": [
2.35177920124,
2.79045389824,
2.34777492924,
2.3720740672400003,
2.73186664824,
2.37728539124,
2.39956321524,
2.49256875124,
2.43004279124,
2.43577173024
]
},
{
"command": "pacquet@main",
"mean": 2.55226069814,
"stddev": 0.14666446685779674,
"median": 2.5169978217400004,
"user": 1.5146772599999998,
"system": 1.2877728000000002,
"min": 2.38702808124,
"max": 2.78494238524,
"times": [
2.38721622524,
2.57614909324,
2.38702808124,
2.44271569524,
2.68429185824,
2.44320922324,
2.45784655024,
2.65070684424,
2.70850102524,
2.78494238524
]
},
{
"command": "pnpr@HEAD",
"mean": 1.49960911344,
"stddev": 0.143992694801458,
"median": 1.42325782074,
"user": 1.04154026,
"system": 1.1119246999999999,
"min": 1.35785505624,
"max": 1.71449291724,
"times": [
1.41660782124,
1.71449291724,
1.60872743324,
1.64560121924,
1.35868351424,
1.42990782024,
1.3984521972400001,
1.67961425324,
1.38614890224,
1.35785505624
]
},
{
"command": "pnpr@main",
"mean": 1.47886434394,
"stddev": 0.13600040781036446,
"median": 1.4431817367400002,
"user": 1.05813706,
"system": 1.1248361,
"min": 1.35086540824,
"max": 1.72172191624,
"times": [
1.48360013624,
1.37217879224,
1.48461625724,
1.4027633372400001,
1.3686414872400001,
1.35086540824,
1.36941978124,
1.72172191624,
1.5420813292400002,
1.69275499424
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25032733086000003,
"stddev": 0.0056793062159201015,
"median": 0.25011001426,
"user": 0.22130204,
"system": 0.50933016,
"min": 0.24380404276000003,
"max": 0.26341247076,
"times": [
0.24791200276000003,
0.24586320676000004,
0.24443566176000003,
0.25260527376,
0.25065076676,
0.26341247076,
0.24380404276000003,
0.24956926176000002,
0.25307750276,
0.25194311876000003
]
},
{
"command": "pacquet@main",
"mean": 0.25453038716,
"stddev": 0.0037145254931496754,
"median": 0.25470113326,
"user": 0.20098903999999998,
"system": 0.52326706,
"min": 0.24677841976000003,
"max": 0.25863568176,
"times": [
0.25690744076,
0.24677841976000003,
0.25863568176,
0.25424605176,
0.25228948076,
0.25832785276,
0.25317458576,
0.25515621476,
0.25176638676,
0.25802175676
]
},
{
"command": "pnpr@HEAD",
"mean": 0.25493084695999996,
"stddev": 0.00603308536545016,
"median": 0.25539379726,
"user": 0.21251044000000002,
"system": 0.50712186,
"min": 0.24823687376000003,
"max": 0.26656629576,
"times": [
0.25329218776,
0.24984946976000003,
0.24890928976000004,
0.24905735876000004,
0.25866986676,
0.25749540676,
0.26656629576,
0.24823687376000003,
0.25906952876,
0.25816219176
]
},
{
"command": "pnpr@main",
"mean": 0.27892778866,
"stddev": 0.004137638243289695,
"median": 0.27739989176,
"user": 0.22732013999999995,
"system": 0.5371618599999999,
"min": 0.27457933476,
"max": 0.28714317576,
"times": [
0.27777241276,
0.27457933476,
0.28179945076,
0.27651659876,
0.28714317576,
0.27702737076,
0.27630768676,
0.27515743076,
0.27879553876,
0.28417888676
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.58178569284,
"stddev": 0.015579956878865547,
"median": 2.58094485824,
"user": 1.5246857600000001,
"system": 1.29688678,
"min": 2.55678797674,
"max": 2.60643186774,
"times": [
2.57379930174,
2.5806249067400002,
2.58182755874,
2.60377451674,
2.56362592774,
2.60643186774,
2.57963010474,
2.59008995774,
2.55678797674,
2.58126480974
]
},
{
"command": "pacquet@main",
"mean": 2.5997502040400002,
"stddev": 0.014010515380138708,
"median": 2.59874325324,
"user": 1.49661156,
"system": 1.3234462800000002,
"min": 2.57828828774,
"max": 2.63283112474,
"times": [
2.60177575974,
2.59508100074,
2.59523307674,
2.58921164474,
2.63283112474,
2.57828828774,
2.60691952074,
2.59887968974,
2.59860681674,
2.60067511874
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6737545731399996,
"stddev": 0.1352789342644051,
"median": 1.69581273874,
"user": 1.0002908599999998,
"system": 1.1490729800000001,
"min": 1.43170057674,
"max": 1.85245913574,
"times": [
1.79952933574,
1.78743249074,
1.5120922077399999,
1.61144495374,
1.67577801474,
1.85245913574,
1.43170057674,
1.71584746274,
1.7582017697399999,
1.59305978374
]
},
{
"command": "pnpr@main",
"mean": 1.5960627734400001,
"stddev": 0.12610465134323406,
"median": 1.63406750224,
"user": 0.99898596,
"system": 1.16441368,
"min": 1.45077329074,
"max": 1.73666232374,
"times": [
1.6816796807399998,
1.67296979874,
1.72794751374,
1.45905029774,
1.45151946474,
1.45077329074,
1.73666232374,
1.5951652057399999,
1.71874964474,
1.46611051374
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.41040253698000007,
"stddev": 0.020726766752845512,
"median": 0.4070478942800001,
"user": 0.5349457999999998,
"system": 0.66899346,
"min": 0.39127454978000004,
"max": 0.46503531178000007,
"times": [
0.41090997178000005,
0.40877900178000004,
0.46503531178000007,
0.40521667778000003,
0.39364822578,
0.3984523977800001,
0.41661344478000006,
0.4062148667800001,
0.40788092178000007,
0.39127454978000004
]
},
{
"command": "pacquet@main",
"mean": 0.41149620418,
"stddev": 0.017326546113320514,
"median": 0.4111651672800001,
"user": 0.5171673,
"system": 0.66926786,
"min": 0.39038328178000004,
"max": 0.44577781078000006,
"times": [
0.3952692667800001,
0.39038328178000004,
0.41244864778000007,
0.40988168678000003,
0.39660482178000006,
0.41667066278000003,
0.44577781078000006,
0.43011395278000003,
0.41904261678000004,
0.39876929378000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.29527914758,
"stddev": 0.0034858666356995132,
"median": 0.29465711728000005,
"user": 0.2030751,
"system": 0.51927566,
"min": 0.29046507278000006,
"max": 0.30074676178000004,
"times": [
0.29046507278000006,
0.29794722378000005,
0.29902113478000003,
0.29523683378000004,
0.29766868978000005,
0.29310977978,
0.29407740078000005,
0.30074676178000004,
0.29385130578000007,
0.29066727278000004
]
},
{
"command": "pnpr@main",
"mean": 0.3045869663800001,
"stddev": 0.004565013509616451,
"median": 0.30433831128000005,
"user": 0.198467,
"system": 0.5345051599999999,
"min": 0.29813228178000006,
"max": 0.3100581947800001,
"times": [
0.30771048778000004,
0.30475975378000003,
0.29926681678000006,
0.3100581947800001,
0.30089769678000006,
0.29813228178000006,
0.30391686878000007,
0.30969477178000004,
0.30990960278000007,
0.30152318878000006
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.6989994115399998,
"stddev": 0.008011163121181292,
"median": 1.70010778204,
"user": 0.7410012599999999,
"system": 0.7207294999999998,
"min": 1.6877073475400002,
"max": 1.71141417854,
"times": [
1.70588369554,
1.70284597254,
1.6877073475400002,
1.7032889375400002,
1.69620664454,
1.71141417854,
1.68782474854,
1.69736959154,
1.6924057355400002,
1.70504726354
]
},
{
"command": "pacquet@main",
"mean": 1.72084170824,
"stddev": 0.00819525760298158,
"median": 1.7231047135400002,
"user": 0.7207527599999999,
"system": 0.7834813,
"min": 1.7059293235400002,
"max": 1.7318566205400001,
"times": [
1.72845581354,
1.7176425245400002,
1.71063379154,
1.7059293235400002,
1.7219363005400001,
1.71595590254,
1.7242731265400002,
1.72657183054,
1.7251618485400002,
1.7318566205400001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.28561547854,
"stddev": 0.004944021099935466,
"median": 0.28426462254,
"user": 0.18651086,
"system": 0.5111485,
"min": 0.28000468054,
"max": 0.29830317854,
"times": [
0.28286787554,
0.28432747054,
0.28000468054,
0.28758672154,
0.28617076754,
0.28420177454,
0.28335115454,
0.29830317854,
0.28305541854,
0.28628574353999997
]
},
{
"command": "pnpr@main",
"mean": 0.30764721293999997,
"stddev": 0.008791778024928807,
"median": 0.30585180704000003,
"user": 0.19774405999999997,
"system": 0.5256316999999999,
"min": 0.29201580254,
"max": 0.32705786454,
"times": [
0.29201580254,
0.32705786454,
0.30489185054,
0.30596106254,
0.30860516654,
0.30995814054,
0.30328903554,
0.30574255154,
0.30569741654,
0.31325323854
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.1980628017,
"stddev": 0.016284020981383745,
"median": 0.1948468325,
"user": 0.17034550666666662,
"system": 0.05227317333333334,
"min": 0.17504424350000003,
"max": 0.22440814450000002,
"times": [
0.19344197950000003,
0.18388719750000002,
0.1826259755,
0.17504424350000003,
0.22141161950000002,
0.19158804350000003,
0.22440814450000002,
0.21511556650000002,
0.20905064850000002,
0.17660949850000002,
0.21734868750000003,
0.19583579150000002,
0.18588427350000003,
0.1948468325,
0.2038435235
]
},
{
"command": "pacquet@main",
"mean": 0.2209953444230769,
"stddev": 0.01759115110471616,
"median": 0.21996864550000003,
"user": 0.1636069169230769,
"system": 0.060701224615384596,
"min": 0.18993355950000002,
"max": 0.24543056750000003,
"times": [
0.22034342950000002,
0.22363640450000002,
0.20182603950000003,
0.23735247250000002,
0.21699339850000002,
0.2115105955,
0.24387601350000002,
0.2109032425,
0.24543056750000003,
0.2447471025,
0.21996864550000003,
0.20641800650000003,
0.18993355950000002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08737852778125002,
"stddev": 0.0009616010732792243,
"median": 0.08744353550000002,
"user": 0.02065605875,
"system": 0.008663224999999998,
"min": 0.08504716250000001,
"max": 0.08994566650000001,
"times": [
0.08776507550000001,
0.0867931665,
0.08549838250000001,
0.08834895450000001,
0.08791519850000001,
0.08730228350000001,
0.08781429850000001,
0.08863894950000001,
0.08504716250000001,
0.08795967150000002,
0.08814990950000001,
0.08703473250000002,
0.08714352650000001,
0.08849689150000001,
0.08619501250000002,
0.08754061350000002,
0.08743691850000002,
0.08994566650000001,
0.08580655150000001,
0.08598335450000001,
0.0875665825,
0.08724230250000001,
0.08745015250000002,
0.08768896250000001,
0.08688416850000001,
0.08797043150000002,
0.08764891650000001,
0.0872617385,
0.08704531150000001,
0.0880084435,
0.08737164550000001,
0.08715791350000002
]
},
{
"command": "pnpr@main",
"mean": 0.08711943353030303,
"stddev": 0.0014073049459852223,
"median": 0.08739982850000001,
"user": 0.020265112727272723,
"system": 0.008658677575757577,
"min": 0.0825529415,
"max": 0.08937428250000001,
"times": [
0.08693784950000001,
0.0876300915,
0.08737085450000001,
0.08746437950000001,
0.08816508750000002,
0.0877050235,
0.0864363855,
0.0886673225,
0.08773005950000001,
0.08847658450000001,
0.0855802055,
0.0882182385,
0.08842710050000001,
0.08628994150000001,
0.08602762850000001,
0.0876090825,
0.08712080350000001,
0.0873661445,
0.08315625650000001,
0.0867354785,
0.08787552350000001,
0.08675740950000001,
0.0825529415,
0.08937428250000001,
0.08534366150000001,
0.08821861850000001,
0.08691145050000001,
0.0876122475,
0.08702073550000002,
0.08785120750000001,
0.08739982850000001,
0.08813609350000001,
0.08677278850000002
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.9037207134333334,
"stddev": 0.2510395175200342,
"median": 0.8435028641,
"user": 0.8660060888888891,
"system": 0.15099796666666665,
"min": 0.6466747961,
"max": 1.4641562351000001,
"times": [
0.6466747961,
0.9284335421000001,
0.7294985341,
0.8435028641,
0.7289650581,
0.9396268661,
0.7581385681,
1.0944899571,
1.4641562351000001
]
},
{
"command": "pacquet@main",
"mean": 0.9033456605444444,
"stddev": 0.1406750035518415,
"median": 0.8775790341,
"user": 0.8467980888888889,
"system": 0.14629007777777778,
"min": 0.7057250861,
"max": 1.0999505471000002,
"times": [
1.0040512971,
1.0999505471000002,
0.7623065171,
0.9223227501,
1.0947605051,
0.8775790341,
0.7057250861,
0.8680868631,
0.7953283451000001
]
},
{
"command": "pnpm@HEAD",
"mean": 2.8680034811,
"stddev": 0.0833148859281346,
"median": 2.8542233941,
"user": 4.426940422222223,
"system": 0.25468174444444436,
"min": 2.7659843511,
"max": 3.0178040121,
"times": [
2.7659843511,
3.0178040121,
2.9212301731,
2.8745664161,
2.9504570421,
2.8445972691000003,
2.7743999801,
2.8542233941,
2.8087686921
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.54291463898,
"stddev": 0.11256407547856949,
"median": 4.59510631018,
"user": 1.69615446,
"system": 1.3087287,
"min": 4.40634488318,
"max": 4.67295369818,
"times": [
4.42151411318,
4.59623869018,
4.59397393018,
4.63291369018,
4.67295369818,
4.40634488318,
4.423995480179999,
4.66477466418,
4.41129880118,
4.60513843918
]
},
{
"command": "pacquet@main",
"mean": 4.552397215779999,
"stddev": 0.15228479442470136,
"median": 4.47146783218,
"user": 1.79447096,
"system": 1.3952742999999999,
"min": 4.419440864179999,
"max": 4.82385908718,
"times": [
4.419440864179999,
4.43886130018,
4.42393675718,
4.73777204218,
4.43277434018,
4.42948215818,
4.6579279181799995,
4.65584332618,
4.50407436418,
4.82385908718
]
},
{
"command": "pnpr@HEAD",
"mean": 3.59045764418,
"stddev": 0.1406218260593659,
"median": 3.5445845666799998,
"user": 1.17060756,
"system": 1.1884142,
"min": 3.45404983318,
"max": 3.88891522118,
"times": [
3.51787077918,
3.75444201118,
3.48256445918,
3.63685293018,
3.56271628218,
3.62534644618,
3.88891522118,
3.45404983318,
3.45536562818,
3.5264528511799997
]
},
{
"command": "pnpr@main",
"mean": 3.5820433632800004,
"stddev": 0.12279395495417726,
"median": 3.56052641418,
"user": 1.21351616,
"system": 1.1672562,
"min": 3.4479579751799996,
"max": 3.8146921991799996,
"times": [
3.48091000618,
3.55427858018,
3.45080359818,
3.5163588241799997,
3.8146921991799996,
3.74142138018,
3.65502052218,
3.4479579751799996,
3.59221629918,
3.5667742481799998
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13739 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,431.70 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 280.00 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 290.47 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 85.05 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,357.86 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,454.05 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 248.24 ms |
Summary
This follows the project-aware managed runtime shims added in #13731 and reduces their warm startup overhead without adding a new cache or trust boundary.
PT_INTERPvalue needed for libc detection instead of reading the complete dispatcher executable on every invocation.pacquetrather than the TypeScriptpnpmpackage.Release Linux benchmark, 500 warm invocations of
node -e 0:The dispatcher overhead falls from about 10.6 ms to 0.9 ms. The optimized parser caps the program-header table at 1 MiB and the interpreter value at 4 KiB; malformed or unsupported ELF layouts fall through to the existing filesystem and command-based libc detection paths.
Validation includes 43 libc detection tests, the managed runtime download integration test, a Windows-target compilation check, all 7,896 Rust tests, and the complete pre-push build/lint/rustdoc/dylint/spelling gate.
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Codex, GPT-5.6).