Skip to content

Use ProcessPoolExecutor instead of ThreadPoolExecutor. - #250

Open
ManishPatelKodiak wants to merge 1 commit into
hedronvision:mainfrom
ManishPatelKodiak:use_process_pool
Open

Use ProcessPoolExecutor instead of ThreadPoolExecutor.#250
ManishPatelKodiak wants to merge 1 commit into
hedronvision:mainfrom
ManishPatelKodiak:use_process_pool

Conversation

@ManishPatelKodiak

@ManishPatelKodiak ManishPatelKodiak commented May 20, 2025

Copy link
Copy Markdown

With the ThreadPoolExecutor, it was observed that the compile commands extractor was effectively running single threaded for substantial periods of time, most likely due to the GIL. CPU utilization was only about one core. Using a ProcessPoolExecutor to work around the GIL seems to provide a substantial performance benefit - it was about 6x faster in a test run.

With the ThreadPoolExecutor, it was observed that the compile commands generator was effectively running single threaded, most likely due to the GIL. CPU utilization was only about one core. Using a ProcessPoolExecutor to work around the GIL seems to provide a substantial performance benefit - it was 6x faster when running on a powerful machine on a very large repo.
helly25 added a commit to helly25/bazel-compile-commands-extractor that referenced this pull request May 17, 2026
Per-action work has enough CPU-bound Python (arg patching, makefile-deps
parsing, regex / path manipulation) that the GIL bottlenecks the
ThreadPoolExecutor to roughly one core. Switching to a ProcessPoolExecutor
was measured at ~6x speedup upstream.

Backport of hedronvision#250
(ManishPatelKodiak).
@helly25

helly25 commented May 17, 2026

Copy link
Copy Markdown

Hi — since upstream has been quiet for a while, the fork at https://github.com/helly25/bazel-compile-commands-extractor has picked up this change as part of a viability sweep.

Backported (with attribution preserved in the commit message) in helly25#11. Thanks for the original patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants