Skip to content

feat(hotpath): fill code-extraction extract/parse gaps - #774

Draft
ScriptedAlchemy wants to merge 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-code-extraction-gaps-ea9c
Draft

feat(hotpath): fill code-extraction extract/parse gaps#774
ScriptedAlchemy wants to merge 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-code-extraction-gaps-ea9c

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

feat(hotpath): fill code-extraction extract/parse gaps

Gap-fill instrumentation for crates/tracedecay-code-extraction (HP-extract) only. Before this PR, 2 of 120 files carried hotpath sites (src/hotpath_observe.rs gauges, src/redundancy.rs two measures); all 51 *_extractor.rs files had zero spans. This adds #[hotpath::measure] to the uniform per-language entry points — trait extract / extract_parsed and inherent extract_tree / parse_source — giving per-language span breakdowns nested under the existing file-level code_extraction.parse_file / code_extraction.traverse_file spans.

  • 191 new measure sites across 51 files, attributes only, zero behavior change.
  • Labels follow code_extraction.<lang>.<verb> with verbs extract, extract_parsed, extract_tree, parse_source.
  • No Cargo.toml or workspace feature changes; macros no-op without --features hotpath, and hotpath* features remain excluded from default/production.
  • Fine-grained visit_* helpers, getters, Display impls, and tests are untouched.
  • Existing measure sites (hotpath_observe.rs, redundancy.rs) left intact.
  • Delegation targets (inherent extract/extract_batch bodies called by the trait extract) were deliberately not annotated to avoid double-counting the same work.

Verified: cargo check -p tracedecay-code-extraction and cargo check -p tracedecay-code-extraction --features hotpath both pass.

Files touched, measure sites, new labels

Verb key per file: E = …extract, EP = …extract_parsed, ET = …extract_tree, PS = …parse_source. Files without an inherent extract_tree/parse_source (composite adapters and delegating extractors) get only the trait entry points.

File (src/) Sites New labels (code_extraction.<lang>.*)
astro_extractor.rs 2 astro.extract, astro.extract_parsed
bash_extractor.rs 4 bash.{extract, extract_parsed, extract_tree, parse_source}
batch_extractor.rs 4 batch.{extract, extract_parsed, extract_tree, parse_source}
c_extractor.rs 4 c.{extract, extract_parsed, extract_tree, parse_source}
clojure_extractor.rs 4 clojure.{extract, extract_parsed, extract_tree, parse_source}
cobol_extractor.rs 4 cobol.{extract, extract_parsed, extract_tree, parse_source}
cpp_extractor.rs 4 cpp.{extract, extract_parsed, extract_tree, parse_source}
csharp_extractor.rs 4 csharp.{extract, extract_parsed, extract_tree, parse_source}
dart_extractor.rs 4 dart.{extract, extract_parsed, extract_tree, parse_source}
dockerfile_extractor.rs 4 dockerfile.{extract, extract_parsed, extract_tree, parse_source}
elixir_extractor.rs 4 elixir.{extract, extract_parsed, extract_tree, parse_source}
erlang_extractor.rs 4 erlang.{extract, extract_parsed, extract_tree, parse_source}
fortran_extractor.rs 4 fortran.{extract, extract_parsed, extract_tree, parse_source}
fsharp_extractor.rs 4 fsharp.{extract, extract_parsed, extract_tree, parse_source}
glsl_extractor.rs 4 glsl.{extract, extract_parsed, extract_tree, parse_source}
go_extractor.rs 4 go.{extract, extract_parsed, extract_tree, parse_source}
gwbasic_extractor.rs 4 gwbasic.{extract, extract_parsed, extract_tree, parse_source}
haskell_extractor.rs 4 haskell.{extract, extract_parsed, extract_tree, parse_source}
hlsl_extractor.rs 4 hlsl.{extract, extract_parsed, extract_tree, parse_source}
java_extractor.rs 4 java.{extract, extract_parsed, extract_tree, parse_source}
julia_extractor.rs 4 julia.{extract, extract_parsed, extract_tree, parse_source}
kotlin_extractor.rs 4 kotlin.{extract, extract_parsed, extract_tree, parse_source}
lean_extractor.rs 3 lean.{extract, extract_parsed, extract_tree}
lua_extractor.rs 4 lua.{extract, extract_parsed, extract_tree, parse_source}
markdown_extractor.rs 2 markdown.extract, markdown.extract_parsed
metal_extractor.rs 2 metal.extract, metal.extract_parsed
msbasic2_extractor.rs 4 msbasic2.{extract, extract_parsed, extract_tree, parse_source}
nix_extractor.rs 4 nix.{extract, extract_parsed, extract_tree, parse_source}
objc_extractor.rs 4 objc.{extract, extract_parsed, extract_tree, parse_source}
ocaml_extractor.rs 4 ocaml.{extract, extract_parsed, extract_tree, parse_source}
pascal_extractor.rs 4 pascal.{extract, extract_parsed, extract_tree, parse_source}
perl_extractor.rs 4 perl.{extract, extract_parsed, extract_tree, parse_source}
php_extractor.rs 4 php.{extract, extract_parsed, extract_tree, parse_source}
powershell_extractor.rs 4 powershell.{extract, extract_parsed, extract_tree, parse_source}
proto_extractor.rs 4 proto.{extract, extract_parsed, extract_tree, parse_source}
python_extractor.rs 4 python.{extract, extract_parsed, extract_tree, parse_source}
qbasic_extractor.rs 4 qbasic.{extract, extract_parsed, extract_tree, parse_source}
quickbasic_extractor.rs 2 quickbasic.extract, quickbasic.extract_parsed
quint_extractor.rs 3 quint.{extract, extract_parsed, extract_tree}
r_extractor.rs 4 r.{extract, extract_parsed, extract_tree, parse_source}
ruby_extractor.rs 4 ruby.{extract, extract_parsed, extract_tree, parse_source}
rust_extractor.rs 4 rust.{extract, extract_parsed, extract_tree, parse_source}
scala_extractor.rs 4 scala.{extract, extract_parsed, extract_tree, parse_source}
sql_extractor.rs 4 sql.{extract, extract_parsed, extract_tree, parse_source}
svelte_extractor.rs 2 svelte.extract, svelte.extract_parsed
swift_extractor.rs 4 swift.{extract, extract_parsed, extract_tree, parse_source}
toml_extractor.rs 3 toml.{extract, extract_parsed, extract_tree}
typescript_extractor.rs 4 typescript.{extract, extract_parsed, extract_tree, parse_source}
vbnet_extractor.rs 4 vbnet.{extract, extract_parsed, extract_tree, parse_source}
wgsl_extractor.rs 4 wgsl.{extract, extract_parsed, extract_tree, parse_source}
zig_extractor.rs 4 zig.{extract, extract_parsed, extract_tree, parse_source}

Total: 51 files, 191 sites, 191 new labels.

Open in Web Open in Cursor 

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: dee2cc5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Performance Comparison codex/tracedecay-total-redesign-plan-reopenedcursor/hotpath-code-extraction-gaps-ea9c

Total Elapsed Time: 4.39s → 4.35s (-0.9%)
CPU Baseline: 79.48µs → 76.32µs (-4.0%)
Benchmark ID: index-bench-timing

timing - Execution duration of functions.

+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| Function                                 | Calls                      | Avg                             | P95                             | Total                           | % Total                      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| tracedecay-index-bench                   | 1 → 1 (+0.0%)              | 4.39s → 4.35s (-0.9%)           | 4.39s → 4.35s (-0.9%)           | 4.39s → 4.35s (-0.9%)           | 100.00% → 100.00% (+0.0%)    |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.append_pages              | 13 → 13 (+0.0%)            | 162.44ms → 161.61ms (-0.5%)     | 222.04ms → 220.46ms (-0.7%)     | 2.11s → 2.10s (-0.5%)           | 48.12% → 48.30% (+0.4%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.batch.sqlite              | 13 → 13 (+0.0%)            | 117.98ms → 118.12ms (+0.1%)     | 162.40ms → 161.61ms (-0.5%)     | 1.53s → 1.54s (+0.7%)           | 34.95% → 35.30% (+1.0%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| CodeIndexProductionOwnerV1::extract_file | 276 → 276 (+0.0%)          | 3.76ms → 3.68ms (-2.1%)         | 5.62ms → 5.51ms (-2.0%)         | 1.04s → 1.02s (-1.9%)           | 23.62% → 23.38% (-1.0%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.workers.install               | 83 → 83 (+0.0%)            | 12.28ms → 12.06ms (-1.8%)       | 42.40ms → 41.91ms (-1.2%)       | 1.02s → 1.00s (-2.0%)           | 23.22% → 23.02% (-0.9%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.batch.postings            | 13 → 13 (+0.0%)            | 72.90ms → 73.23ms (+0.5%)       | 99.68ms → 100.27ms (+0.6%)      | 947.75ms → 951.98ms (+0.4%)     | 21.60% → 21.88% (+1.3%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.build.and_publish             | 2 → 2 (+0.0%)              | 398.53ms → 392.21ms (-1.6%)     | 401.87ms → 398.98ms (-0.7%)     | 797.05ms → 784.42ms (-1.6%)     | 18.16% → 18.03% (-0.7%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| domain.canonical.sha256                  | 114526 → 114526 (+0.0%)    | 7.06µs → 6.83µs (-3.3%)         | 11.77µs → 11.38µs (-3.3%)       | 808.69ms → 782.12ms (-3.3%)     | 18.43% → 17.98% (-2.4%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.finalization.advance_wake | 14 → 14 (+0.0%)            | 49.33ms → 49.90ms (+1.2%)       | 216.66ms → 228.33ms (+5.4%)     | 690.58ms → 698.63ms (+1.2%)     | 15.74% → 16.06% (+2.0%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.batch.commit              | 13 → 13 (+0.0%)            | 42.40ms → 42.22ms (-0.4%)       | 59.34ms → 58.16ms (-2.0%)       | 551.17ms → 548.92ms (-0.4%)     | 12.56% → 12.62% (+0.5%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.prepare_pages             | 13 → 13 (+0.0%)            | 38.76ms → 37.81ms (-2.5%)       | 55.41ms → 54.36ms (-1.9%)       | 503.89ms → 491.55ms (-2.4%)     | 11.48% → 11.30% (-1.6%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.chunk.index_file              | 276 → 276 (+0.0%)          | 1.79ms → 1.74ms (-2.8%)         | 2.58ms → 2.50ms (-3.1%)         | 493.57ms → 480.53ms (-2.6%)     | 11.25% → 11.05% (-1.8%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.extract.parser_artifact       | 276 → 276 (+0.0%)          | 1.59ms → 1.58ms (-0.6%)         | 2.36ms → 2.36ms (+0.0%)         | 437.68ms → 436.07ms (-0.4%)     | 9.97% → 10.02% (+0.5%)       |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.batch.parallel_prepare    | 13 → 13 (+0.0%)            | 30.75ms → 30.11ms (-2.1%)       | 43.97ms → 43.38ms (-1.3%)       | 399.75ms → 391.43ms (-2.1%)     | 9.11% → 9.00% (-1.2%)        |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| 🆕 code_index.chunk.build                | 0 → 276 (+100.0%) ⚠️       | 0.00ns → 1.06ms (+100.0%) ⚠️    | 0.00ns → 1.52ms (+100.0%) ⚠️    | 0.00ns → 293.61ms (+100.0%) ⚠️  | 0.00% → 6.75% (+100.0%) ⚠️   |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| 🗑️ code_index.chunk.map_ordered          | 780 → 0 (-100.0%) 🚀       | 402.38µs → 0.00ns (-100.0%) 🚀  | 466.69µs → 0.00ns (-100.0%) 🚀  | 313.86ms → 0.00ns (-100.0%) 🚀  | 7.15% → 0.00% (-100.0%) 🚀   |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+

Generated with hotpath-rs

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.

2 participants