Uh oh!
There was an error while loading. Please reload this page.
lookup exported symbols only when needed. - #48219
Conversation
rust-highfive
commented
Feb 14, 2018
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
half the time was only for an empty file due to I measured wrong (had --crate-type lib for a file with only an main function ) but hay big win for #43300 :) for other files the translation time go down 10ms so 3-4% |
Mark-Simulacrum
commented
Feb 14, 2018
Could you make the Otherwise I feel pretty good about this! |
andjo403
commented
Feb 15, 2018
@Mark-Simulacrum shall I split it up in two optional variables then one for local create and other? or shall I only have one if with lto or not? And what shall I do in lto.rs when there is none in the variable? is it possible to move this to the use in lto.rs my feeling was that it was not wanted/possible. will try to fix this after work today |
michaelwoerister
commented
Feb 15, 2018
One field for the whole list is fine. In |
There was a problem hiding this comment.
Could you turn this whole block into a match tcx.sess.lto() { ... } instead of two nested ifs? It's a bit more verbose but it makes it easier to read.
michaelwoerister
commented
Feb 15, 2018
Great find, btw! |
andjo403
commented
Feb 15, 2018
I'm not sure this PR was a good idea. also I'm to bad at rust to understand how to update the code in lto.rs if I change to a Arc<Option> when I try to get the value with the Option::expect() I get a compile error and I do not understand how to solve it. |
Mark-Simulacrum
commented
Feb 15, 2018
This should have no effect on linking time, though perhaps that incorporates parts of Rust code too. I'm not sure. I don't see why this would be a net loss. With regards to the option, you probably want something like |
andjo403
commented
Feb 15, 2018
have already tried with as_ref and get the same error :( |
andjo403
commented
Feb 15, 2018
got it to compile now have no idea why :) |
Mark-Simulacrum
commented
Feb 16, 2018
Ah, the |
Mark-Simulacrum
commented
Feb 16, 2018
It'd actually be nice to flip the |
reduces the time to emit dep-info and metadata.
andjo403
commented
Feb 16, 2018
started with that order of Arc and the Option but when I did not get it to compile I changed thanks for the comments. |
michaelwoerister
commented
Feb 16, 2018
Linking needs the list of exported symbols too, so it will be computed there instead of earlier. However, the overall time should be the same in that case, while can skip computing the list in cases without linking. It would be great if you could verify this though (that the overall build time is roughly the same for builds that do linking). |
andjo403
commented
Feb 16, 2018
the time-passes listed abow is what differs between the runs so when linking I see a 40ms longer compile time with this PR. |
andjo403
commented
Feb 16, 2018
the function that takes longer time is this rust/src/librustc_trans/back/link.rs Line 800 in 58a8e0c but I do not see how this PR change any thing in that function very strange. |
michaelwoerister
commented
Feb 19, 2018
That's weird. Let's test it perf.rust-lang.org to see if the difference is visible there too. @bors try |
bors
commented
Feb 19, 2018
lookup exported symbols only when needed. reduces the time to compile small file with no optimization by half.
bors
commented
Feb 19, 2018
☀️ Test successful - status-travis |
michaelwoerister
commented
Feb 19, 2018
@Mark-Simulacrum, could you do a perf run please? |
Mark-Simulacrum
commented
Feb 20, 2018
Must've forgot to leave a comment that I queued it. http://perf.rust-lang.org/compare.html?start=27a046e9338fb0455c33b13e8fe28da78212dedc&end=682bc88006582c2e549d0c5b26a1f41a682f2a18&stat=instructions%3Au (done). Looks fairly good overall. |
andjo403
commented
Feb 20, 2018
have tested om my other computer and can not see any degradation of the compile time when linking. |
@andjo403 "style-servo-opt clean incremental" is flaky so you can ignore it (check out the front page http://perf.rust-lang.org/). So, nice wins all around :) |
Mark-Simulacrum
commented
Feb 20, 2018
michaelwoerister
commented
Feb 21, 2018
bors
commented
Feb 21, 2018
📌 Commit 7041ef3 has been approved by |
…erister lookup exported symbols only when needed. reduces the time to compile small file with no optimization by half.
reduces the time to compile small file with no optimization by half.