Uh oh!
There was an error while loading. Please reload this page.
std: Cut down #[inline] annotations where not necessary - #43367
Conversation
rust-highfive
commented
Jul 20, 2017
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
TimNN
commented
Jul 20, 2017
I'm not exactly sure, but is this still true? If I recall correctly, there were some changes (to the collector?) a while ago, which changed the behaviour here |
oyvindln
commented
Jul 20, 2017
I know that at least that a adding inline to |
This PR cuts down on a large number of `#[inline(always)]` and `#[inline]` annotations in libcore for various core functions. The `#[inline(always)]` annotation is almost never needed and is detrimental to debug build times as it forces LLVM to perform inlining when it otherwise wouldn't need to in debug builds. Additionally `#[inline]` is an unnecessary annoation on almost all generic functions because the function will already be monomorphized into other codegen units and otherwise rarely needs the extra "help" from us to tell LLVM to inline something. Overall this PR cut the compile time of a [microbenchmark][1] by 30% from 1s to 0.7s. [1]: https://gist.github.com/alexcrichton/a7d70319a45aa60cf36a6a7bf540dd3a
8778b8b to
53d8b1dComparealexcrichton
commented
Jul 20, 2017
@TimNN ah yes I always forget that |
alexcrichton
commented
Jul 22, 2017
r? @sfackler |
sfackler
commented
Jul 22, 2017
@bors r+ |
bors
commented
Jul 22, 2017
📌 Commit 53d8b1d has been approved by |
bors
commented
Jul 22, 2017
std: Cut down #[inline] annotations where not necessary This PR cuts down on a large number of `#[inline(always)]` and `#[inline]` annotations in libcore for various core functions. The `#[inline(always)]` annotation is almost never needed and is detrimental to debug build times as it forces LLVM to perform inlining when it otherwise wouldn't need to in debug builds. Additionally `#[inline]` is an unnecessary annoation on almost all generic functions because the function will already be monomorphized into other codegen units and otherwise rarely needs the extra "help" from us to tell LLVM to inline something. Overall this PR cut the compile time of a [microbenchmark][1] by 30% from 1s to 0.7s. [1]: https://gist.github.com/alexcrichton/a7d70319a45aa60cf36a6a7bf540dd3a
bors
commented
Jul 22, 2017
☀️ Test successful - status-appveyor, status-travis |
This PR cuts down on a large number of
#[inline(always)]and#[inline]annotations in libcore for various core functions. The
#[inline(always)]annotation is almost never needed and is detrimental to debug build times as it
forces LLVM to perform inlining when it otherwise wouldn't need to in debug
builds. Additionally
#[inline]is an unnecessary annoation on almost allgeneric functions because the function will already be monomorphized into other
codegen units and otherwise rarely needs the extra "help" from us to tell LLVM
to inline something.
Overall this PR cut the compile time of a microbenchmark by 30% from 1s to
0.7s.