-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Improve startup time of bootstrap #111562
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
r? @ozkanonur (rustbot has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
b17afcb
to
361190a
Compare
This comment has been minimized.
This comment has been minimized.
361190a
to
e3abbd3
Compare
This comment has been minimized.
This comment has been minimized.
e3abbd3
to
1feec75
Compare
1feec75
to
4249728
Compare
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.
Thank you for the enhancement, looks great:) Only one non-blocker suggestion
--
r=me once the CI is green
@bors rollup=iffy |
@bors r=ozkanonur |
📌 Commit 4249728f3eca3efb59264dfaf7ce1852080c0f69 has been approved by It is now in the queue for this repository. |
⌛ Testing commit 4249728f3eca3efb59264dfaf7ce1852080c0f69 with merge 7d63b30bd1d9ca39bdcb71fd21a85697be41e588... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
Looks like the triple should be x86_64-unknown-gnu, but the symlink is Lines 503 to 517 in eda41ad
'host' seems to refer to the build triple, rather than the actual host triple |
4249728
to
7daced1
Compare
src/bootstrap/bootstrap.py
Outdated
|
||
ostype = ostype.decode(default_encoding) | ||
cputype = cputype.decode(default_encoding) | ||
uname = require(["uname", "-smop"]).decode(default_encoding) |
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.
Save a few cycles time by lifting all the uname
invocations to a single command
cd36321
to
33fe42b
Compare
@bors r=jyn514 |
📌 Commit 33fe42bcc5fe42af90ccbd3286f94f0153689ee0 has been approved by It is now in the queue for this repository. |
⌛ Testing commit 33fe42bcc5fe42af90ccbd3286f94f0153689ee0 with merge 3aa56dfe33d61d57f8852cf9f6d6617aca6489a0... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
|
33fe42b
to
9a86ceb
Compare
@bors r+ rollup=iffy |
☀️ Test successful - checks-actions |
Finished benchmarking commit (917b0b6): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 644.999s -> 643.928s (-0.17%) |
This PR seems to have broken the configure utility on my machine.
The offending line is https://github.com/rust-lang/rust/pull/111562/files#diff-9e25a089f077eae8c8cefe9586cc07498e64cd950be4c954cb90e4245e5f9fc3R259. On my machine the output of |
If the user has abuild/host
symlink set up, we can determine the target triple by reading it rather than invoking rustc. This significantly reduces startup time of bootstrap once any kind of build has been doneNew approach explained below
Also a small microoptimisation in using string splitting rather than regex when reading toml, which saves a few more milliseconds (2-5 testing locally), but less important.
Profiling shows the remaining runtime is around half setting up the Python runtime, and the vast majority of the remaining time is spent in subprocess building and running bootstrap itself, so probably can't be improved much further.