Skip to content

perf: optimize DWARF line and abbreviation lookups - #260

Merged
swananan merged 2 commits into
mainfrom
perf/data-oriented-line-index
Jul 27, 2026
Merged

perf: optimize DWARF line and abbreviation lookups#260
swananan merged 2 commits into
mainfrom
perf/data-oriented-line-index

Conversation

@swananan

@swananan swananan commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • store compacted line rows and address groups in contiguous vectors while keeping an ordered incremental tail for lazy CU loading
  • compact the incremental line index geometrically to avoid rebuilding all previously loaded rows on every CU query
  • prepopulate gimli abbreviation tables once and reuse their shared Arcs across source-line, function, variable, and type lookups
  • generate an in-memory DWARF fixture so cache coverage is independent of test-profile debuginfo

Performance

The abbreviation-cache step was benchmarked in isolation against the preceding line-index commit on the fixed query-hotspot corpus (12 alternating process pairs, 1,000 queries per process):

  • average source-line query: 3.405 ms -> 1.643 ms (51.7% faster)
  • first query: 5.335 ms -> 2.796 ms (47.6% faster)
  • p95 query: 3.885 ms -> 1.951 ms (49.8% faster)
  • parse-stress average load: 50.86 ms -> 50.17 ms (no observed regression)

Validation

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test -p ghostscope-dwarf (266 unit tests plus compatibility coverage)
  • cargo test -p ghostscope-dwarf --release loaded_dwarf_reuses_cached_abbreviations --all-features
  • full host-to-host e2e through the project runner (7024c13cd8f0)

Container-topology e2e was skipped because the changes do not affect containers, PID namespaces, or runner topology.

swananan added 2 commits July 27, 2026 18:53
Keep compacted line rows in contiguous arrays for cache-friendly address
lookups. Use an incremental ordered tail between geometric compactions so
lazy CU loading does not rebuild all prior rows on every query.
Prepopulate gimli’s abbreviation cache because source-line queries revisit
compilation units across function, variable, and type lookups.

This removes repeated abbreviation decoding from the query hot path while
reusing shared Arc-backed tables.
@swananan
swananan merged commit 25caf05 into main Jul 27, 2026
10 checks passed
@swananan
swananan deleted the perf/data-oriented-line-index branch July 27, 2026 14:22
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