You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(bench): simplify metrics and improve time formatting
Simplified benchmark metrics and improved readability per user feedback:
**Removed Metrics**:
- Removed ops/sec (iterations show throughput)
- Removed MB/s (didn't make sense for all benchmarks)
- Removed total_time_sec (benchtime is fixed at 2s)
**Improved Time Formatting**:
- Changed "ns/op" to "Latency/op"
- Added intelligent time unit formatting:
- <1µs: displays as nanoseconds (e.g., "0.24ns", "7.18ns")
- <1ms: displays as microseconds (e.g., "1.06µs", "95.19µs")
- <1s: displays as milliseconds (e.g., "1.23ms")
- >=1s: displays as seconds (e.g., "2.45s")
- Removed scientific notation for small numbers (now "0.24" instead of "2.4e-01")
**Number Formatting Improvements**:
- All numbers now use 2 decimal places for consistency
- Better K/M/B suffix formatting (e.g., "2.25M", "15.58K")
**Configuration**:
- Added -benchtime=2s for consistent results across runs
- All benchmarks now run for exactly 2 seconds
**Updated Columns**:
- "Ops/Sec" → "Iterations" (shows actual iteration count)
- "ns/op" → "Latency/op" (with smart time units)
- Removed "MB/s" column
- Kept "B/op" and "allocs/op"
Example output:
```
Benchmark Iterations Latency/op B/op allocs/op
MetadataFromFile 8.88K 267.93µs 569.54KB 3.62K
Metadata_Tag 334.43M 7.18ns - -
Parser_Parse 1.52M 1.60µs 4.53KB 54.00
```
Much more readable and easier to compare performance across benchmarks!
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
0 commit comments