Packages

package perf

Type Members

  1. 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-stack workspace 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 by toResult per parse — see HotPathMetrics doc). It does NOT cover P1-2 / the isolated-file applyAmfVisitors fallback (Relationships.buildVisitors stays 0, applyAmfVisitors fires 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 in als-bench, not by these counts. When P1-2 is implemented, extend this test with a standalone-file open + rename so Relationships.buildVisitors actually fires.

    The asserts include upper bounds on parsedUnits.rebuild and definitionFor that 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.

Ungrouped