Skip to content

index: speed up call and comment attribution - #139

Open
12458 wants to merge 2 commits into
facebookexperimental:mainfrom
12458:index-source-analysis-perf
Open

12458 wants to merge 2 commits into
facebookexperimental:mainfrom
12458:index-source-analysis-perf

Conversation

@12458

@12458 12458 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Sort captured calls by starting byte so each function only examines call sites in its source range.
  • Share source lines and comment captures between function and type extraction, and start each comment search immediately above the definition.

Validation

  • All 621 tests passed with cargo test --offline --locked -j 2 --quiet.
  • Before-and-after analyzer output matched on 10 C and Rust files, including two Linux kernel files and six downstream packaging fixtures.
  • In release-mode measurements of source analysis, a generated C file with 5,000 functions went from 1.46 s to 0.28 s. Linux's kernel/sched/fair.c analyzed about 2.4 times as fast in repeated runs. Both measurements include both commits.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 20, 2026
@12458 12458 changed the title Speed up call and comment attribution during indexing index: speed up call and comment attribution Nov 20, 2026
@12458
12458 marked this pull request as ready for review November 20, 2026 07:43
@12458
12458 force-pushed the index-source-analysis-perf branch from 7c26a91 to 0eb7229 Compare November 20, 2026 07:55

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant