Conversation
Following the [benchmarks from Hugo van Kemenade](https://hugovk.dev/blog/2025/ready-prek-go/), we get about 3× faster with prek: | | pre-commit | prek | Ratio | | --------------- | ---------- | --------- | ----- | | run --all-files | 4m52.503s | 1m26.718s | 3.373 | | install-hooks | 3m31.002s | 1m6.608s | 3.168 | | hyperfine | 176.214 | 58.500 | 3.01 | with hyperfine results of: ``` Benchmark 1: prek install-hooks Time (mean ± σ): 58.500 s ± 15.029 s [User: 8.485 s, System: 3.138 s] Range (min … max): 30.766 s … 76.617 s 10 runs Benchmark 2: pre-commit install-hooks Time (mean ± σ): 176.214 s ± 11.544 s [User: 31.003 s, System: 5.127 s] Range (min … max): 161.969 s … 198.271 s 10 runs Summary prek install-hooks ran 3.01 ± 0.80 times faster than pre-commit install-hooks ```
|
Sounds like upstream of prek is also reasonable to work with which is a major plus. |
story645
left a comment
There was a problem hiding this comment.
Thanks for updating the dev docs!
|
Where does the speedup for |
|
This is without the cache, so it is also installing all venvs required for running the linters. For day-to-day, it's probably not so much faster, except when we start changing configs or something that requires rebuilding them. As Hugo mentioned, I think, this doesn't do anything for speeding up the linters themselves. That is, mypy is probably going to be the slowest thing if it has to go through all files. While prek does have a fast path for some of the regular hooks, I don't think we have enough code for those to dominate times at all. If I edit one file, |
|
Even just the install speedup is nice to have. Yesterday I used my clone on my work machine for the first time in a while, and was kind of annoyed about having to wait for those hooks to install! |
|
The improved disk usage offered by The number of times I've had to purge a scary amount of GBs from my |
PR summary
Following the benchmarks from Hugo van Kemenade, we get about 3× faster with prek:
with hyperfine results of:
These benchmarks were run on my desktop, which is several generations behind, but was more idle than my laptop. I would run on my laptop (which is still about 5 years old), but I don't really want to wait for hyperfine to do another long run like that.
Since we aren't using pre-commit's CI anyway, it's easy to switch GitHub Actions directly.
PR checklist