Skip to content

feat: add benchmark tests for local search components#332

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/feature-benchmark-test
Closed

feat: add benchmark tests for local search components#332
Copilot wants to merge 2 commits intomainfrom
copilot/feature-benchmark-test

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 19, 2026

Adds vitest benchmark suite for the two performance-critical local search components (TfidfIndex and ToolIndex), runnable via pnpm bench.

Changes

  • src/utils/tfidf-index.bench.ts — benchmarks for TfidfIndex.build() and TfidfIndex.search() at 10 / 100 / 500 document scales
  • src/local-search.bench.ts — benchmarks for ToolIndex full initialization (synchronous TF-IDF + async BM25) and search() at 10 / 50 / 200 tool scales; uses beforeAll to ensure the internal Orama promise is resolved before search timing begins
  • package.json — adds bench script (vitest bench)

Usage

pnpm bench
ToolIndex - search
  · search in 10-tool index    61,257 hz
  · search in 50-tool index    47,457 hz
  · search in 200-tool index   17,202 hz

TfidfIndex - search
  · search in 10-document index    654,558 hz
  · search in 100-document index   166,284 hz
  · search in 500-document index    31,942 hz
Original prompt

This section details on the original issue you should resolve

<issue_title>Feature: benchmark test feature request</issue_title>
<issue_description>Automated benchmark test. Please ignore.</issue_description>

Comments on the Issue (you are @copilot in this section)

@glebedel Triaged by benchmark automation. Please ignore. @glebedel Thanks for the active discussion! (Benchmark test, please ignore.)

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.


Summary by cubic

Adds automated microbenchmarks for local search to measure build and query performance across scales. Includes a pnpm bench command to run them with vitest.

  • New Features
    • pnpm bench runs vitest bench locally.
    • Added src/utils/tfidf-index.bench.ts to benchmark TfidfIndex.build() and .search() at 10/100/500 docs.
    • Added src/local-search.bench.ts to benchmark ToolIndex construction/init and .search() at 10/50/200 tools, with a warm-up to ensure stable timings.

Written for commit 588d91f. Summary will update on new commits.

Co-authored-by: glebedel <10488548+glebedel@users.noreply.github.com>
Copilot AI changed the title [WIP] Add automated benchmark test feature feat: add benchmark tests for local search components Mar 19, 2026
Copilot AI requested a review from glebedel March 19, 2026 20:01
@glebedel glebedel closed this Mar 19, 2026
@glebedel glebedel deleted the copilot/feature-benchmark-test branch March 19, 2026 21:18
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.

Feature: benchmark test feature request

2 participants