v0.41.52: startup cost no longer grows with the package store (#581) #583
No reviewers
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index!583
Loading…
Reference in a new issue
No description provided.
Delete branch "integration-1113"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix-forward release for #581.
v0.41.51is tagged on master but was never published: its release run stopped in the Windows archive smoke on this defect. This branch is master plus the fix and the version bump.The defect (#581)
Since
f73682d5(first shipped in v0.41.49) the answer "which language names are available" read every archive in the user's package store and computed two content hashes for each. One process asked about 22 times, mostly throughConfig::warnings(), so every start of a process paid for every installed package, used or not.languages enable/index/ one-shot querylanguages enable/index/ one-shot queryindex_incompleteMeasured by the lead on one machine with the same script; the 45-package store is a copy of this machine's installed packages.
The fix
Store::declared_language_names), never the payload, and computes no hash. It reads fresh on every call, so a package installed, replaced or removed while a daemon runs changes the answer (testadvisory_names_follow_installs_replacements_and_removals, mutation run).warn).PackageSetresolves the known names lazily, asowner_rows_inalready did.Store::get, signature, trust, approval and enablement checks still read and hash every byte of a package that is used.Gate
unused_packages_add_no_archive_hashes_or_full_reads(crates/cli/tests/plugin_activation_cli.rs) counts archive reads and metadata parses in one single-process startup and oneindex, with a real loadable package and a non-builtin language enabled, before and after installing eight unused packages. It asserts that the unused packages add nothing and are never read, and that the one used package stays within four reads per startup and three perindex. No wall-clock bound.Store::get_unverified_bytes, 8 vs 4, red.Release smoke (
tests/release_language_smoke.ps1)"retryable": trueis retried at most four times within 60 s and the script says so; every other failure stays fatal.mcr.microsoft.com/powershellimage against the fixed Linux build: passed, query step 1.46 s. Windows is covered by the release run only.Also
m2_acceptancegives its fixture an ownCODE_INDEX_HOME; before, the benchmark's time depended on the packages installed on the machine that ran it.Qualification
code-index-cli,code-index-mcpon both legs, fmt, clippy, rustdoc: all exit 0 (worker run, logs kept). Lead: counting gate and its mutation, both timing tables, the smoke script.172bcb20(01:03–03:22, 43 steps): all 43 passed and no record moved (git statusclean;tests/corpus/*.json,tests/bench/ratchet.jsonand the package parity files unchanged). It covers formatting, fast gates, clippy for the host andx86_64-pc-windows-gnu, rustdoc, the workspace and MCP suites on both legs with their timing profiles,precision_gate7/7 with seven population lines, the CI corpus suites, the eleven package legs, scale and tier-3 corpus, packages-only and shipped-shape acceptance, and the nightly-only cost steps includinglanguage_package_overhead(3 passed).ci.ymlrun 8637 passed all 16 jobs; it was dispatched by hand, so it also ran the nightly-only jobs (tier-3 scale, grammar rebuild, plugin path cost withlanguage_package_overhead3 passed). Ten earlier runs on this head tested nothing: the runners could not resolveindex.crates.io,static.rust-lang.orgorcode.forgejo.orgfor about eight hours (#582). One run in between (8631) failed in a single test,sfc_first_contact_delegates_script_languages_and_refuses_only_unavailable_regions: the index was stillreconcilingafter 60 s. The same commit passed that test in run 8637 and in every local run (36 s alone, 102 s with the machine oversubscribed two-fold; the previous master takes 144 s). The cause of that one failure is not known; it is recorded on #582.Not in this PR
🤖 Generated with Claude Code