FrankYang0529 opened a new pull request, #75437:
URL: https://github.com/apache/airflow/pull/75437

   ### Why
   
   The prek treats each `.pre-commit-config.yaml` as a project. It runs the 
most deeply nested projects first and the root `.pre-commit-config.yaml` last, 
on its own. Inside one config, prek groups hooks by their `priority` value. 
Hooks with the same value run in parallel, with at most `PREK_CONCURRENT_HOOKS` 
hooks at a time. `PREK_CONCURRENT_HOOKS` defaults to the CPU count, which is 4 
on the CI runners. A group starts only after the previous group has finished.  
A hook without `priority` gets its position in the file as its priority, 
counted from 0. No root hook sets `priority` today. As a result, each root hook 
forms a group of its own, and the root hooks run one at a time.
   
   ### How
   
   Set `priority: 1000` on 22 root hooks that take 2 s or more in CI and are 
safe to run in parallel. The value 1000 is larger than  hook count in the file, 
so this group runs after all the other root hooks. The other root hooks still 
run one at a time.
   
   ### Local results
   
   - The 22 hooks took 66 to 72 s when they ran one after another, and 34 to 37 
s as a group.
   - The whole root config took 155 to 170 s without this change and 119 to 133 
s with it.
   
   * related: #75205
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   <!--
   If generative AI tooling has been used in the process of authoring this PR, 
please
   change below checkbox to `[X]` followed by the name of the tool, uncomment 
the "Generated-by".
   -->
   
   - [X] Yes - Claude Code
   
   <!--
   Generated-by: [Tool Name] following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to