Skip to content

perf(build): TLS seeds from the system, and locations index lines once per file - #276

Merged
sweepies merged 3 commits into
mainfrom
perf/startup
Nov 12, 2026
Merged

sweepies merged 3 commits into
mainfrom
perf/startup

Conversation

@sweepies

@sweepies sweepies commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Consult 7, PR 1. Two startup and scan costs every command paid.

TLS seeds from the operating system, not from CPU jitter. aws-lc-sys built jitterentropy at -O0 and AWS-LC seeded from it on every process start (about 0.15–0.2 s of CPU). .cargo/config.toml sets AWS_LC_SYS_NO_JITTER_ENTROPY=1, AWS-LC's documented opt-out, which seeds from the system generator. Every build path runs cargo from the workspace root, so CI, release:package (musl and darwin) and the zig-wrapped musl build all pick it up. release:package fails if the aws-lc-sys archive of the target it built has a jent_ symbol, or if there is no archive to check. The archive keeps its symbols on every target even though the musl binaries are stripped: on x86_64 musl it has 13,345 symbols and no jent_ (120 before).

Locations index lines once per file. Location::new counted newlines from the start of the file for every location, which is quadratic in a lockfile. Lines builds the line-start index once per file in Scanner::extract, and every extractor shares it (yaml_locations drops its own copy).

Proof: the corpus extraction and proposal snapshots are byte-identical before and after.

Benchmarks (VM, musl release builds, alternating, user CPU in seconds):

before after
warm lookup, tests/corpus/javascript 0.22–0.25 0.09–0.12
scan, tests/corpus (1,377 dependencies) 0.75–0.96 0.35–0.51

View guided diff Turn on auto-fix

…its symbols

The musl binaries are stripped, so nm on them found nothing and the check
could never fail there. The aws-lc-sys rlib keeps its symbols on every
target (13,345 on x86_64 musl, no jent_), and a missing archive fails the
release instead of passing it.
@sweepies
sweepies merged commit ba41a0e into main Nov 12, 2026
12 checks passed
@sweepies
sweepies deleted the perf/startup branch November 12, 2026 15:41
@sweepies-ops sweepies-ops Bot mentioned this pull request Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant