Performance characteristics of progressbar2
developBased on benchmark results for version 4.5.0, progressbar2 is optimized for low per-iteration overhead and efficient rendering:
- Low Per-Iteration Overhead: It has a default overhead of approximately 5 ns per iteration, making it highly suitable for fast loops where minimal interference is required.
- Efficient Rendering: A single bar redraw takes approximately 25.5 µs. While
progressbar2-fastis faster for raw rendering,progressbar2is significantly more efficient than libraries likerichfor standard updates. - Throttled Redraws: By default,
progressbar2caps redraws at approximately 20 per second (a 50 ms floor). This means the per-iteration cost (the overhead of checking if a redraw is needed) is the dominant factor in most real-world workloads, rather than the cost of the render itself. - Import Weight: It has a relatively low cold import time (approx. 1.5 ms), making it suitable for short-lived CLI tools.