indexing_throughput

command
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

indexing_throughput measures the wall time, peak memory, and per-phase breakdown of code-graph's pipeline.Run() against a target directory.

Plan 4 T3b (~/Documents/knowledge-base/plans/2026-05-06-codegraph-followup.md post-roundtable). Closes performance gaps #8 (memory footprint), #9 (cold- start), and #10 (indexing throughput) from the 2026-05-06 roundtable META_SYNTHESIS F5.

MEASUREMENT APPROACH:

The harness drives Pipeline.Run() in-process (not via the MCP binary) because:

  1. The dominant work — tree-sitter parsing, multi-pass extraction, SQLite writes — is exercised identically.
  2. In-process measurement is reproducible (no subprocess setup).
  3. We can wire Pipeline.Progress callbacks to record per-phase wall times, which the binary doesn't surface.

Memory measurement uses runtime.MemStats. This captures Go-side heap allocations but NOT CGO-side (tree-sitter) memory. The Sys field reflects total OS memory committed by the Go runtime including CGO arena overhead, so we report both HeapInuse and Sys peak.

Cold-start time is measured separately: time from process start to the first phase callback ("discover").

Output is a JSON baseline file with the same schema pattern as bench/research/baselines/2026-05-06-mcp-latency.json (Plan 3 Phase B).

Usage:

go run ./bench/research/indexing_throughput \
    -target . \
    -output bench/research/baselines/2026-05-06-indexing-throughput.json

# Incremental run (re-index against an already-indexed project):
go run ./bench/research/indexing_throughput -target . -mode incremental

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL