-
Notifications
You must be signed in to change notification settings - Fork 19
Demo: Build graph rust (Parallel) #263
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
Conversation
CodSpeed Performance ReportMerging #263 will improve performances by ×2.4Comparing Summary
Benchmarks breakdown
Footnotes
|
2faf7b7 to
820a724
Compare
820a724 to
a539f95
Compare
seddonym
left a comment
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 is very exciting! I can confirm that it's noticeably faster locally, on a large code base.
With cache: 2.3s -> 0.9s (Subsecond for the first time!)
Without cache: 3.2s -> 2.5s.
It would be interesting to see how we could move this over while retaining the same Python-based testing approach, in particulary things like interacting with fake file systems. How far away are we from having a PR that switches to this implementation while still retaining the testing approach?
src/grimp/application/usecases.py
Outdated
|
|
||
| # Create the graph_builder | ||
| package_spec = rust.PackageSpec(package_name, package_directory) | ||
| graph_builder = rust.GraphBuilder(package_spec) |
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.
Not convinced this should be a mutable class - why not just a function?
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.
Yes made it a function now - that's more pythonic
src/grimp/application/usecases.py
Outdated
| rust_graph = graph_builder.build() | ||
|
|
||
| # Wrap the rust graph in our ImportGraph wrapper | ||
| graph = ImportGraph() |
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.
We should encapsulate this so we don't need to access private attributes here.
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.
Done it
More pythonic than builder pattern.
rust/src/graph/builder/mod.rs
Outdated
| self | ||
| } | ||
|
|
||
| pub fn build(&self) -> Graph { |
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.
Added error handling a bit late 0c28293, would have been better to do this from the start 🙈
fb44e8b to
5a80389
Compare
1000 is still enough, and it allows deadlocks to show up in the test suite if we've gotten the logic wrong.
5a80389 to
d3091f2
Compare
7f73cbf to
dd95e72
Compare
@seddonym Yeah this is the main change related to this PR. I don't really know how to integrate the abstract file system approach, at least not without compromising performance. See the I'm a bit unsure how much the abstract/fake file system help us. It makes the tests a bit faster, but I wonder how much. Are we sure we couldn't get away with testing on the actual file system (temporary files)? If I add an |
|
I'll close this PR since #264 is almost as fast and is conceptually simpler. |
Closed in favor of
#264
A demo showing a complete port of
build_graphto rust, for your interest/consideration @seddonymThe benchmark results from my machine: