-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Backend refactorings and perf improvements #6867
Commits on Apr 22, 2019
-
Remove the
Vec<Job>
fromDependencyQueue
I... don't think this needed any more! Doing some digging looks like this was originally added in 79768eb. That was so early it didn't even use a PR and was almost 5 years ago. Since then we've had a huge number of changes to the backend and `Unit` nowadays does all the deduplication we need, so no need to store a `Vec` here and we can just have a mapping of `Key` to `Job` and that's it.
Configuration menu - View commit details
-
Copy full SHA for 21ea254 - Browse repository at this point
Copy the full SHA 21ea254View commit details -
Correct a condition to request jobserver tokens
This looks like it was a bug ever present from the original implementation of a GNU jobserver in rust-lang#4110, but we currently unconditionally request a token is allocated for any job we pull off our job queue. Rather we only need to request tokens for everything but the first job because we already have an implicit token for that job.
Configuration menu - View commit details
-
Copy full SHA for b36594d - Browse repository at this point
Copy the full SHA b36594dView commit details -
Refactor JobQueue::run slightly
Take a `&Context` argument instead of a few component arguments, avoids passing around some extraneous information.
Configuration menu - View commit details
-
Copy full SHA for 21cae01 - Browse repository at this point
Copy the full SHA 21cae01View commit details -
Remove the
Key
type fromJobQueue
This isn't actually necessary with a bit of refactoring, and in general it makes management of `JobQueue` simpler since there's one less type to worry about. The one main usage of `Key` vs `Unit` was that `Key` was `Send` to be placed in `Message`, but this was replaced by just assigning each `Unit` an ever-increasing integer, and then `Finished` contains the integer rather than the `Key` itself which we can map once we get back to the main thread.
Configuration menu - View commit details
-
Copy full SHA for 12e0ffa - Browse repository at this point
Copy the full SHA 12e0ffaView commit details -
Sort units once, not each call to
dep_targets
The code lying around in `dep_targets` is pretty old at this point, but given the current iteraiton there's no need to re-sort on each call to `dep_targets`, only initially during construction!
Configuration menu - View commit details
-
Copy full SHA for 7246028 - Browse repository at this point
Copy the full SHA 7246028View commit details -
Avoid reparsing
env_args
continuouslyWe only need to parse this information once, so calculate it when a `TargetInfo` is created and then just reuse that from then on out.
Configuration menu - View commit details
-
Copy full SHA for bd8253f - Browse repository at this point
Copy the full SHA bd8253fView commit details -
This commit starts to intern `Unit` structures for a few reasons: * This primarily makes equality and hashing much faster. We have tons of hash lookups with units, and they were showing up quite high in profiles. It turns out `Unit` hashes a *ton* of data, and most of it is always redundant. To handle this they're all only hashed once now and hashing/equality are just pointer checks. * The size of `Unit` is now drastically reduced to just one pointer, so movement of units throughout the backend should be much more efficient.
Configuration menu - View commit details
-
Copy full SHA for e454446 - Browse repository at this point
Copy the full SHA e454446View commit details -
Turn
Workspace::is_member
into anO(1)
queryThis commit moves it from a linear query which does a lot of hashing of `PathBuf` to an `O(1)` query that only hashes `PackageId`. This improves Servo's null build performance by 50ms or so, causing a number of functions to disappear from profiles.
Configuration menu - View commit details
-
Copy full SHA for f660b3e - Browse repository at this point
Copy the full SHA f660b3eView commit details -
Hoist a workspace membership check out of a loop
This commit moves a linear scan which happens once-per-each-dependency to an O(1) lookup which happens only once for each package. This removes another 30ms or so from a null build in Servo.
Configuration menu - View commit details
-
Copy full SHA for d274fba - Browse repository at this point
Copy the full SHA d274fbaView commit details
Commits on Apr 23, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 32269f4 - Browse repository at this point
Copy the full SHA 32269f4View commit details