Skip to content

feat(benchmarks): performance benchmarking for regression detection#377

Merged
raifdmueller merged 3 commits into
mainfrom
351-performance-benchmarks
May 26, 2026
Merged

feat(benchmarks): performance benchmarking for regression detection#377
raifdmueller merged 3 commits into
mainfrom
351-performance-benchmarks

Conversation

@paulefl
Copy link
Copy Markdown
Collaborator

@paulefl paulefl commented May 7, 2026

Summary

Implements comprehensive performance benchmarking suite for regression detection with 12 benchmarks covering critical code paths.

Changes:

  • internal/benchmarks/benchmarks_test.go: 12 benchmark functions (model load/validate, flatten, export, file I/O)
  • .github/workflows/benchmarks.yml: CI pipeline with baseline comparison and >5% regression alerts
  • BENCHMARKS.md: Interpretation guide, SLO targets (all met), optimization opportunities
  • benchmarks/main.txt: Baseline metrics for regression detection

Metrics (Linux 2.9GHz baseline):

  • Model load: 474μs (100 elems), 2.6ms (500 elems)
  • Validation: 214μs (100 elems), 1.4ms (500 elems)
  • Diagram export: 45.9μs per view
  • All operations within SLO targets

CI Integration:

  • Runs on every PR (compare vs baseline)
  • Updates baseline on main push
  • Flags regressions >5% (informational, non-blocking)
  • Uses benchstat for automated comparison

Fixes #351

🤖 Generated with Claude Code

Implements comprehensive benchmark suite with 12 benchmarks covering:
- Model loading (JSONC parsing): 474μs (100 elems), 2.6ms (500 elems)
- Model validation: 214μs (100 elems), 1.4ms (500 elems)
- Hierarchy flattening: 29.5μs
- Diagram export: 45.9μs per view
- Table export (Markdown/AsciiDoc): 60μs
- JSON roundtrip: 764μs
- File I/O: 476μs write, 1.8ms read
- Combined operations: 263μs

Changes:
- internal/benchmarks/benchmarks_test.go: 12 benchmark functions with synthetic model generation
- .github/workflows/benchmarks.yml: CI pipeline with regression detection and baseline comparison
- BENCHMARKS.md: Interpretation guide, SLO targets, optimization opportunities
- benchmarks/main.txt: Baseline metrics for regression detection

CI Integration:
- Run on every push to main (update baseline)
- Run on every PR (compare vs baseline, flag >5% regressions)
- Uses benchstat for automated comparison

Fixes #351

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
paulefl and others added 2 commits May 7, 2026 07:17
- Suppress json.Unmarshal errors (lines 68, 80)
- Suppress model.FlattenElements error (line 110)
- Suppress diagram.FormatView and table.Format errors (lines 128, 141+)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Line 187 was missing error handling for model.Save call.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@raifdmueller raifdmueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Superior benchmark implementation: 12 benchmarks (vs 8 in #372), CI integration with baseline comparison, regression detection at >5%, comprehensive documentation. Merge-ready — this supersedes #372.

@raifdmueller raifdmueller merged commit b354b72 into main May 26, 2026
6 checks passed
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.

feat: Performance Benchmarks für Sync & Export mit Regression Detection

2 participants