Skip to content

test(bench): benchmark suite for cluster, MMR, selector, and compress (#24)#69

Merged
Siddhant-K-code merged 1 commit into
mainfrom
feat/24-benchmarks
May 2, 2026
Merged

test(bench): benchmark suite for cluster, MMR, selector, and compress (#24)#69
Siddhant-K-code merged 1 commit into
mainfrom
feat/24-benchmarks

Conversation

@Siddhant-K-code

Copy link
Copy Markdown
Owner

Closes #24

Summary

Adds deterministic benchmarks using fixed-seed random embeddings so results are reproducible across runs.

Benchmarks

pkg/contextlab

  • BenchmarkCluster_{10,50,100,500}Chunks — agglomerative clustering at varying scales
  • BenchmarkMMR_{10,50}Chunks — MMR reranking
  • BenchmarkSelector_{10,50}Clusters — cluster representative selection

pkg/compress

  • BenchmarkCompress_ShortText — single short chunk
  • BenchmarkCompress_LongText — 50× repeated sentence (~3500 chars)

Running

go test -bench=. -benchmem ./pkg/contextlab/... ./pkg/compress/...
# or via Makefile:
make bench

Files

  • pkg/contextlab/bench_test.go
  • pkg/compress/bench_test.go

Implements issue #24. Adds deterministic benchmarks using fixed-seed
random embeddings so results are reproducible across runs:

- BenchmarkCluster_{10,50,100,500}Chunks (pkg/contextlab)
- BenchmarkMMR_{10,50}Chunks (pkg/contextlab)
- BenchmarkSelector_{10,50}Clusters (pkg/contextlab)
- BenchmarkCompress_{Short,Long}Text (pkg/compress)

Run with: go test -bench=. -benchmem ./pkg/contextlab/... ./pkg/compress/...

Co-authored-by: Ona <[email protected]>
@Siddhant-K-code Siddhant-K-code added the enhancement New feature or request label May 2, 2026
@Siddhant-K-code Siddhant-K-code merged commit a9a40b0 into main May 2, 2026
1 of 2 checks passed
@Siddhant-K-code Siddhant-K-code deleted the feat/24-benchmarks branch May 2, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Benchmark suite with CI integration

1 participant