-
Notifications
You must be signed in to change notification settings - Fork 280
Closed
Labels
Milestone
Description
When executing hooks, it would be significantly faster to run hooks in parallel rather than serially.
Benefits
- Faster hook runs that scale with the number of processors on a machine
Costs
- The
HookRunnerclass will need some serious rethinking to support the collection of hook statuses as they are completed in parallel - This will change overcommit to be a multi-threaded application, so interrupt handling (and signal handlers) will need to handle cases gracefully. Testing this will be difficult.
- If Allow hooks to depend on other hooks #143 is implemented, parallelism is potentially hindered depending on the dependency graph. This also introduces complexity as we can no longer just run hooks in topological sort order, but would need to trigger dependent hooks to run once all their dependencies passed.
Questions
- What happens if a hook generates files during its run?
This is a potentially big issue. Since we're now running hooks in parallel the temporary files generated by some hooks could potentially affect other hook runs. We may have to support aparallelizeoption which can be set tofalseto force serial execution in extreme cases - What happens if a hook runs
gitcommands?
Similar to the file issue above, somegitcommands require exclusive access to the files in the.gitdirectory during their run. We'll likely need agithelper (similar toexecute) that serializes requests so hooks don't accidentally trample on each other
Feel free to leave comments and ask questions in this issue.