Skip to content

Commit 867e973

Browse files
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

File tree

3 files changed

+465
-150
lines changed

3 files changed

+465
-150
lines changed

Cargo.lock

Lines changed: 194 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ parking_lot = "0.12.3"
2424
dashmap = "6.1.0"
2525
smallvec = "1.15.0"
2626
memchr = "2.7.4"
27+
crossterm = "0.28"
28+
serde = { version = "1.0", features = ["derive"] }
29+
serde_json = "1.0"
30+
comfy-table = "7.1"
2731

2832
[build-dependencies]
2933
clap = { version = "4.5.39", features = ["derive", "cargo"] }

0 commit comments

Comments
 (0)