Skip to content

Enhance benchmark harness, typing, and robustness; refactor RouteMatcher and git error parsing#240

Merged
AhmmedSamier merged 1 commit intomasterfrom
codex/review-language-server-code-and-benchmarks
Mar 1, 2026
Merged

Enhance benchmark harness, typing, and robustness; refactor RouteMatcher and git error parsing#240
AhmmedSamier merged 1 commit intomasterfrom
codex/review-language-server-code-and-benchmarks

Conversation

@AhmmedSamier
Copy link
Owner

Motivation

  • Improve benchmark tooling to capture variance metrics and remove noisy git-related artifacts during indexing benchmarks.
  • Replace widespread any usages in benchmarks with lightweight typed interfaces to catch schema drift and improve maintainability.
  • Reduce cognitive complexity and increase clarity of URL detection logic in RouteMatcher.
  • Make git error parsing in the indexer more robust and predictable.

Description

  • Extended the benchmark utility in benchmarks/utils.ts to record per-iteration samples and emit minMs, maxMs, p95Ms, and stdDevMs in addition to avgMs and totalMs, and updated the saveBenchmarks signature and result typing.
  • Updated many benchmark files under language-server/benchmarks/* to use typed SearchableItem arrays and small local interfaces, replaced any usages, added helper functions like createBenchmarkConfig and initializeGitRepo, and ensured temp directories are optionally initialized as git repos to avoid noisy git errors.
  • Replaced ad-hoc casts to access private members with small local interfaces (e.g. BenchmarkActivityTracker, IncrementalIndexer, ModifiedFileEngine) and used typed casts where necessary to keep intent explicit.
  • Refactored RouteMatcher.isPotentialUrl into smaller helpers (isHttpMethod, skipSpaces, isPotentialPathStartChar) to simplify logic and reduce cognitive complexity.
  • Improved git error parsing in WorkspaceIndexer.getGitExitCode to use RegExp.exec and safer checks when extracting an exit code.
  • Added a review file language-server/reviews/language-server-review-2026-02-28.md with findings and recommendations from the benchmarking/run.
  • Updated language-server/benchmarks/benchmarks.json with newly recorded benchmark metrics produced by the enhanced harness.

Testing

  • Executed the full benchmark suite under language-server/benchmarks which completed and produced an updated benchmarks.json with the new metrics fields, and all benchmark runs finished successfully.
  • Performed a TypeScript build (npm run build / tsc) on the language-server codebase to validate typings and compilation, which completed successfully.
  • No automated lint test results are claimed here; linting findings are documented in the added review file for follow-up.

Codex Task

@AhmmedSamier AhmmedSamier merged commit d5bedb5 into master Mar 1, 2026
1 check passed
@AhmmedSamier AhmmedSamier deleted the codex/review-language-server-code-and-benchmarks branch March 1, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant