Commit 867e973
committed
feat(bench): migrate to crossterm with colors, progress bars, and comfy-table
Complete UI overhaul with modern terminal features:
**Dependencies Added:**
- crossterm (0.28): Terminal manipulation, colors, cursor control
- serde + serde_json (1.0): Proper JSON serialization (no more manual string building!)
- comfy-table (7.1): Native table rendering with UTF-8 box drawing
**UI Improvements:**
1. **Colored Output:**
- Green ✓ for success, Red ✗ for errors
- Yellow table headers
- Magenta for scaling analysis
- Cyan for headers and labels
- Green/Yellow highlights for fastest/slowest in summary
2. **Progress Bars:**
- Live progress: [████░░░░] 54% (15/28) - Current template
- Updates in place (no scrolling spam)
- Shows current template being benchmarked
3. **Professional Tables (comfy-table):**
- UTF-8 box-drawing characters (┌─┐│╞═╡etc.)
- Colored headers (yellow)
- Color-coded rows in summary (green=fastest, yellow=slowest)
- Dynamic content arrangement
4. **Enhanced Headers:**
- Boxed header: ╔═══ String Pipeline Throughput Benchmark ═══╗
- Section headers with horizontal lines
- Clear visual hierarchy
**JSON Output (serde):**
- Replaced 80+ lines of manual string concatenation
- Now uses proper Serialize derives
- Type-safe, no more concatenation errors
- Duration fields serialized as nanoseconds
- Clean, maintainable code
**Code Quality:**
- Removed artificial operation breakdown (was fake data)
- Added serialize_duration helper for consistent Duration handling
- Proper error handling with Result types
- Cleaner separation of concerns
**Modes Supported:**
- Normal: Full colored output with progress bars
- Quiet (--quiet): Minimal output, just success indicators
- JSON (--format json): Proper serde serialization to file or stdout
**Backwards Compatibility:**
- All existing CLI flags work
- JSON output structure preserved (now type-safe)
- Same benchmark logic, just better presentation
Before: Plain text with manual formatting
After: Modern terminal UI with colors, progress, and native tables ✨1 parent 000e2f5 commit 867e973
3 files changed
+465
-150
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| |||
0 commit comments