Skip to content

[DO NOT MERGE] temporary: time clangd's module BMI rebuild on real projects - #29

Draft
Sunrisepeak wants to merge 2 commits into
mainfrom
tmp/bmi-rebuild-timing
Draft

Sunrisepeak wants to merge 2 commits into
mainfrom
tmp/bmi-rebuild-timing

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Owner

Temporary draft, opened only to get numbers from CI; it will be closed without merging.

Question: how much of an mcppls cold start is clangd rebuilding the modules' BMIs (module preparation)? The answer decides whether a consumer-side universal BMI (clangd reading an IFC the GCC build already wrote) is worth doing (mcpp-safe research).

What it changes (measurement only):

  • src/engine/clangd.cpp: the clangd engine's report carries preparationTiming: each primed module's time from its import M; didOpen to its first diagnostics, the preparation window, and clangd's CPU seconds at both ends and now.
  • src/bin/conformance.cpp: with MCPPLS_MEASURE_PREPARATION set, --measure waits for preparation to finish (up to 15 min) and records that report section.
  • .github/workflows/tmp-bmi-timing.yml: linux-x64, self-mcpp / real-xlings / self-mcppls, cold then warm; the table goes to the step summary, the JSON to the bmi-timing artifact.

Locally, the timing fixture: cold first navigation 3.4 s with a 2.1 s preparation window (std 1.8 s), clangd 4.9 of 5.1 CPU seconds in preparation; warm 0.8 s with nothing primed.

…jects

Instruments module preparation (per-module prime duration, the preparation window and
clangd's CPU at both ends) in the clangd engine's report, has the conformance runner wait
for preparation and record it under MCPPLS_MEASURE_PREPARATION, and adds a linux-x64
workflow timing self-mcpp, real-xlings and self-mcppls cold and warm.
…hots per start

Once preparation is idle and MCPPLS_MEASURE_PREPARATION is set, the clangd engine writes its
log ring to <cache>/clangd-ring.log; the workflow keeps it, the server logs and a .pcm snapshot
after the cold and the warm start, to tell whether the warm start built BMIs again.
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