package perf
Type Members
-
class
HotPathMetricsTest extends LanguageServerBaseTest
Hot-path invocation-count harness — the *deterministic* layer of the performance before/after dissection.
Hot-path invocation-count harness — the *deterministic* layer of the performance before/after dissection.
Rather than timing wall-clock (which is dominated by AMF parse/resolution, out of ALS scope and noisy), this test drives a realistic multi-step LSP session against the cross-referenced
performance-stackworkspace and records how many times each redundant computation actually ran (via HotPathMetrics).The counts are stable across runs and machines, so:
- On
develop(no fixes) they establish a baseline. - After applying a fix they should drop; the delta is the proof the redundant work was removed.
SCOPE — this session opens only IN-TREE files, so it covers:
- P0-1 (
parsedUnits.rebuild, single-source — the headline counter), - P0-2 (
contains), - R12 (
definitionFor, multi-sourced: also called bytoResultper parse — see HotPathMetrics doc). It does NOT cover P1-2 / the isolated-fileapplyAmfVisitorsfallback (Relationships.buildVisitorsstays 0,applyAmfVisitorsfires once for the tree build). The O(n²) AST walk (P0-3) and the O(files²) merge (P0-4) are proven by the JMH benchmarks inals-bench, not by these counts. When P1-2 is implemented, extend this test with a standalone-file open + rename soRelationships.buildVisitorsactually fires.
The asserts include upper bounds on
parsedUnits.rebuildanddefinitionForthat GATE the P0-1 win: a regression to the pre-fix counts (73 / 2,337) fails here, not just in the doc. The printed report remains the before/after artefact. - On