Title: Replace pre-commit with prek for faster linting · Issue #143148 · python/cpython · GitHub
Open Graph Title: Replace pre-commit with prek for faster linting · Issue #143148 · python/cpython
X Title: Replace pre-commit with prek for faster linting · Issue #143148 · python/cpython
Description: Feature or enhancement Proposal: First, I hope this is the correct issue template. If not, please let me know, and I can resubmit the proposal using the proper template. prek is a "reimagined version of pre-commit, [...] designed to be a...
Open Graph Description: Feature or enhancement Proposal: First, I hope this is the correct issue template. If not, please let me know, and I can resubmit the proposal using the proper template. prek is a "reimagined versi...
X Description: Feature or enhancement Proposal: First, I hope this is the correct issue template. If not, please let me know, and I can resubmit the proposal using the proper template. prek is a "reimagined ...
Opengraph URL: https://github.com/python/cpython/issues/143148
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Replace pre-commit with prek for faster linting","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nFirst, I hope this is the correct issue template. If not, please let me know, and I can resubmit the proposal using the proper template.\n\n[prek](https://github.com/j178/prek) is a \"reimagined version of pre-commit, [...] designed to be a faster, dependency-free and drop-in alternative\".\nIt has already been adopted by major projects from Apache, FastAPI, and Django (see [prek/Who is using prek?](https://github.com/j178/prek#who-is-using-prek)).\n\nRunning prek against the entire CPython codebase yields a speedup of almost 2.5x without a cache and 1.25x with a warm cache.\n\n```shell\nhyperfine --warmup 2 --runs 5 \\\n --prepare \"prek cache clean\" \"prek run --all-files\" \\\n --prepare \"pre-commit clean\" \"pre-commit run --all-files\"\nBenchmark 1: prek run --all-files\n Time (mean ± σ): 19.835 s ± 0.290 s [User: 50.857 s, System: 6.248 s]\n Range (min … max): 19.527 s … 20.201 s 5 runs\n\nBenchmark 2: pre-commit run --all-files\n Time (mean ± σ): 48.944 s ± 0.448 s [User: 76.063 s, System: 6.096 s]\n Range (min … max): 48.522 s … 49.681 s 5 runs\n\nSummary\n prek run --all-files ran\n 2.47 ± 0.04 times faster than pre-commit run --all-files\n```\n\n```shell\nhyperfine --warmup 2 --runs 5 \\\n \"prek run --all-files\" \\\n \"pre-commit run --all-files\"\nBenchmark 1: prek run --all-files\n Time (mean ± σ): 6.763 s ± 0.124 s [User: 35.990 s, System: 2.134 s]\n Range (min … max): 6.589 s … 6.900 s 5 runs\n\nBenchmark 2: pre-commit run --all-files\n Time (mean ± σ): 8.537 s ± 0.048 s [User: 43.797 s, System: 1.903 s]\n Range (min … max): 8.484 s … 8.608 s 5 runs\n\nSummary\n prek run --all-files ran\n 1.26 ± 0.02 times faster than pre-commit run --all-files\n```\n\n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-143149\n* gh-143359\n* gh-143360\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/juhannc","@type":"Person","name":"juhannc"},"datePublished":"2025-12-24T15:26:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":18},"url":"https://github.com/143148/cpython/issues/143148"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0c0cb3c9-df12-daa2-c943-d789109e57ff |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A7C:861EA:184C7FB:209FFDA:6969BEA1 |
| html-safe-nonce | aed4b1194c221700983a0b427bc8fe81770d9071e409737b8afbff3f39fcf6b4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTdDOjg2MUVBOjE4NEM3RkI6MjA5RkZEQTo2OTY5QkVBMSIsInZpc2l0b3JfaWQiOiIzMjQ3NjY4MzIwMzk0NjU3NDQxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b5a73dee8a5ade1fbecd6446a1cb2bf729ba803473af464a09481817a9a75632 |
| hovercard-subject-tag | issue:3760582217 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/143148/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8d3dd7c41dbc2cce90f02461d27275f1108f83f693d1ab9c8fedc6c3666b0991/python/cpython/issues/143148 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8d3dd7c41dbc2cce90f02461d27275f1108f83f693d1ab9c8fedc6c3666b0991/python/cpython/issues/143148 |
| og:image:alt | Feature or enhancement Proposal: First, I hope this is the correct issue template. If not, please let me know, and I can resubmit the proposal using the proper template. prek is a "reimagined versi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | juhannc |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width