Benchmark 1: str(1)
Time (mean ± σ): 138.2 ns ± 2.2 ns
Range (min … max): 135.6 ns … 141.6 ns [runs: 20,000,000]
Benchmark 2: f'{1}'
Time (mean ± σ): 54.6 ns ± 0.8 ns
Range (min … max): 53.9 ns … 55.9 ns [runs: 50,000,000]
Summary:
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Bar Chart ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ str(1) [135.6 ns]: ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ ┃
┃ f'{1}' [53.9 ns]: ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━ (lower is better) ━━━━━━━━━━━━━━━━━━━━━━━━━━┛
f'{1}' is the fastest.
2.53 (2.51 … 2.53) times faster than str(1)