diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-18 09:36:34 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-18 09:41:33 +0900 |
| commit | 0feaef06d0a4b3476a5d2ac53119a67559cd0a82 (patch) | |
| tree | 049609246698ed1f9da3187d5e917cc0f213b923 /crates/shirabe/src/dependency_resolver/solver_bug_exception.rs | |
| parent | 4856f05e870ec5d2daaa74bf9a86a1519a813614 (diff) | |
| download | php-shirabe-0feaef06d0a4b3476a5d2ac53119a67559cd0a82.tar.gz php-shirabe-0feaef06d0a4b3476a5d2ac53119a67559cd0a82.tar.zst php-shirabe-0feaef06d0a4b3476a5d2ac53119a67559cd0a82.zip | |
perf(metadata-minifier): defer copying versions out of expand
MetadataMinifier::expand now returns ExpandedVersions, which holds the
minified input plus, for each expanded version, a table of references to
where its fields live. A version is copied only when materialize() asks
for it. ComposerRepository::load_async_packages runs its constraint and
stability filters straight off that view through the new VersionFields
trait, so the versions it rejects are never copied at all.
Benchmarks are new under crates/shirabe/benches. load_packages against
real packagist p2 metadata, before -> after:
symfony/console (768 versions)
0 accepted 9.01 ms -> 4.40 ms -51%
50 accepted 10.70 ms -> 6.30 ms -41%
147 accepted 13.17 ms -> 9.62 ms -27%
329 accepted 18.58 ms -> 16.89 ms -9%
663 accepted 27.27 ms -> 27.89 ms +2%
laravel/framework (1277 versions)
0 accepted 39.44 ms -> 11.22 ms -72%
81 accepted 44.76 ms -> 18.25 ms -59%
840 accepted 125.44 ms -> 120.12 ms -4%
1266 accepted 163.18 ms -> 182.01 ms +12%
The crossover sits near 80% acceptance. Past it the view loses, because
materialize rebuilds a map where the old code cloned one, and the
minified input stays alive alongside the copies; the 1266-of-1277 case
measured between +5% and +12% across runs. Loads with a real constraint
sit far below the crossover.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/dependency_resolver/solver_bug_exception.rs')
0 files changed, 0 insertions, 0 deletions
