Skip to content

perf: avoid repeated export line scans#55

Closed
longlho wants to merge 1 commit into
mainfrom
codex/line-col-lookup
Closed

perf: avoid repeated export line scans#55
longlho wants to merge 1 commit into
mainfrom
codex/line-col-lookup

Conversation

@longlho
Copy link
Copy Markdown
Contributor

@longlho longlho commented May 22, 2026

Summary

  • avoid repeatedly scanning from the start of a source file for every exported symbol's line/column
  • keep the existing single-export path unchanged, and build a per-file line-start table only for files with multiple exports
  • add a parser unit test that checks the line-start lookup against the original scanner, including non-ASCII text

Benchmark Notes

Kibana fixture, --samples 3 --warmups 1 --skip-knip --skip-build:

Build Codescythe
origin/main baseline 13988.2ms +/-10.57%
this branch 13401.0ms +/-2.55%

The optimized Kibana JSON output was byte-for-byte identical to the origin/main output for the same config.

Validation

  • git diff --check
  • bazel build -c opt //crates/codescythe_cli:codescythe
  • cmp -s /private/tmp/kibana-baseline-output.json /private/tmp/kibana-linecol-output.json
  • bazel test //crates/codescythe:codescythe_test //crates/codescythe_cli:codescythe_cli_test //benchmarks:kibana_fixture_test

@longlho longlho closed this May 22, 2026
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