Closed sharkdp closed 5 years ago
Reading input is currently really slow:
▶ pastel random -n 1000 > colors ▶ hyperfine 'pastel format hex < colors' Benchmark #1: pastel format hex < colors Time (mean ± σ): 313.8 ms ± 5.9 ms [User: 309.8 ms, System: 3.5 ms] Range (min … max): 307.8 ms … 327.9 ms 10 runs
The main reason is that we compile the regexes in each iteration:
After the fix:
Benchmark #1: pastel format hex < colors Time (mean ± σ): 5.5 ms ± 1.3 ms [User: 4.0 ms, System: 1.7 ms] Range (min … max): 3.3 ms … 10.5 ms 476 runs
Reading input is currently really slow:
The main reason is that we compile the regexes in each iteration:![image](https://user-images.githubusercontent.com/4209276/61251720-895dd000-a75b-11e9-8904-82b292317852.png)