-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build perf: Make calls to bindgen run in parallel #159
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pr speeds up the build by parallelizing the generation of the bindings in outdir and in the generated_bindings folder. The latter was only added since it was easier to get diffs between prs when there are bindgen changes. I have a pr that removes this duplicate generation (since that pr also introduces feature in #82 so it doesnt make sense to only look at the km bindings diff).
I have written a cargo make task that will generate these binding diffs, and will clean it up and pr in the near future
I am still good to merge this until that lands
This is a little silly with all the clones, but it works.
When compiling this repo (or projects that depend on it), a large portion of the build time is spent waiting for bindgen to finish constructing bindings to the WDK. This can severely slow down iterative development and builds.
This PR makes a simple change to how we call bindgen by calling each function wrapping a call to it in parallel. On my machine this provides a speedup of running "cargo make" in windows-drivers-rs of about 20% (~500 seconds run time to ~400 seconds).
I wouldn't be surprised if we can refactor the calls even more to see greater speedups, but this was just a quick late afternoon project to speed up work on other features.