Skip to content

feat: add BenchmarkComputeLineDiff for diff regression testing#332

Merged
tomasz-tomczyk merged 1 commit intomainfrom
feat/lcs-benchmarks
Apr 21, 2026
Merged

feat: add BenchmarkComputeLineDiff for diff regression testing#332
tomasz-tomczyk merged 1 commit intomainfrom
feat/lcs-benchmarks

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

Summary

  • Add BenchmarkComputeLineDiff with 100/1000/5000 line sub-benchmarks
  • Realistic code-like data generation with ~20% mutations (insertions, deletions, modifications)
  • Reports allocations via b.ReportAllocs()

Baseline results (Apple M2 Pro)

Size ns/op B/op allocs/op
100 lines 36,738 112,464 112
1,000 lines 2,619,892 8,379,741 1,015
5,000 lines 53,601,601 206,429,800 5,021

Test plan

  • go vet ./... clean
  • go test -race -count=1 ./... passes
  • Benchmarks run successfully
  • Reviewed by Go expert agent — approved

🤖 Generated with Claude Code

The LCS diff algorithm is the most performance-sensitive pure algorithm in the
codebase but had no benchmarks. Adds BenchmarkComputeLineDiff with 100, 1000,
and 5000 line inputs using realistic code-like content with ~20% mutations
(insertions, deletions, modifications).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tomasz-tomczyk tomasz-tomczyk merged commit 596ddda into main Apr 21, 2026
4 checks passed
@tomasz-tomczyk tomasz-tomczyk deleted the feat/lcs-benchmarks branch April 21, 2026 21:24
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