Skip to content

Add TreeDB vector search profiling hook - #2330

Open
snissn wants to merge 1 commit into
mainfrom
codex/vector-search-profile-dir
Open

Add TreeDB vector search profiling hook#2330
snissn wants to merge 1 commit into
mainfrom
codex/vector-search-profile-dir

Conversation

@snissn

@snissn snissn commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • add an opt-in -search-profile-dir flag to treedb_vector_search_demo for column_graph search runs
  • emit per-concurrency cpu, heap, allocs, block, and mutex profiles with the search_<mode>_c<N>_*.pprof prefix
  • record the effective profile directory in JSON output and document the profiling caveats
  • add TREEDB_SEARCH_PROFILE_DIR passthrough to scripts/bench_vector_db_compare.sh, using backend-specific subdirectories to avoid overwrites

Validation

  • GOWORK=off go test -count=1 ./cmd/treedb_vector_search_demo
  • bash -n scripts/bench_vector_db_compare.sh
  • git diff --check
  • tiny harness smoke with TREEDB_SEARCH_PROFILE_DIR set:
    • BACKENDS=treedb_column_graph_quantized_rerank DOCS=64 DIMS=8 QUERIES=4 VALIDATE_QUERIES=0 VALIDATE_DOCS=0 TOP_K=3 SEARCH_CONCURRENCY=1,2 M=4 EF_CONSTRUCTION=32 EF_SEARCH=32 MIN_RECALL=0 TREEDB_QUANTIZED_RERANK_MIN_RECALL=0 TREEDB_SEARCH_PROFILE_DIR=/tmp/vector_db_profile_script_smoke_20260604_143430/profiles RUN_DIR=/tmp/vector_db_profile_script_smoke_20260604_143430 GOWORK=off scripts/bench_vector_db_compare.sh
    • verified 10 profile files under /tmp/vector_db_profile_script_smoke_20260604_143430/profiles/treedb_column_graph_quantized_rerank
    • verified JSON search_profile_dir points at that backend-specific profile directory

Profiling Notes

This PR adds the hook needed for repeatable profiling; it does not claim profiled timings as comparison numbers. CPU profiles are scoped to the measured search loop. Heap, allocation, block, and mutex profiles are supporting runtime snapshots and may include process state beyond the search loop. Enabling profiles changes latency and throughput, so unprofiled runs should remain the source for published benchmark numbers.

In the c=1/c=8 quantized_rerank investigation that motivated this, the c=8 CPU profile on the post-traversal artifact run pointed primarily at scalar_u8 indexed dot scoring, SearchCosine, scratch clearing, top-candidate insertion, and quantized scorer traversal work, with exact rerank scoring a smaller contributor.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@snissn, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 56 minutes and 31 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 065c1763-3bc4-4b6c-8cc8-cd7068a0b8b2

📥 Commits

Reviewing files that changed from the base of the PR and between 4ee6a88 and 0a73a0e.

📒 Files selected for processing (5)
  • benchmarks/vector_db_compare/README.md
  • cmd/treedb_vector_search_demo/README.md
  • cmd/treedb_vector_search_demo/main.go
  • cmd/treedb_vector_search_demo/main_test.go
  • scripts/bench_vector_db_compare.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/vector-search-profile-dir

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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