Uh oh!
There was an error while loading. Please reload this page.
Mark libserialize functions as inline - #53393
Conversation
rust-highfive
commented
Aug 15, 2018
r? @dtolnay (rust_highfive has picked a reviewer for you, use r? to override) |
dtolnay
commented
Aug 15, 2018
Nice find. Looks good to me if the benchmarks are corroborated. |
bors
commented
Aug 15, 2018
⌛ Trying commit e59ea2fc56ef72b3ac332ccd28310d0662a186c0 with merge e895c391336eabdd2ec4d9f4c94a45c94f6902b0... |
There was a problem hiding this comment.
Clearly this isn't my fault, as nobody made a lint for it!
e59ea2f to
bc900f5CompareBurntPizza
commented
Aug 15, 2018
Rebased.
|
BurntPizza
commented
Aug 16, 2018
@Mark-Simulacrum Could I get a perf run? Or are we waiting on making a dent in the queue? |
| impl< | ||
| T: Encodable | ||
| > Encodable for LinkedList<T> { | ||
| #[inline] |
There was a problem hiding this comment.
I thought #[inline] was unnecessary on generic methods?
There was a problem hiding this comment.
IIRC, ever since multiple codegen units, it can matter. I forget.
| } | ||
| #[inline] | ||
| pub fn read_raw_bytes(&mut self, s: &mut [u8]) -> Result<(), String> { |
There was a problem hiding this comment.
The #[inline]s on things like this and write_signed_leb128 seem definitely good, though 👍
Mark-Simulacrum
commented
Aug 16, 2018
@rust-timer build e895c391336eabdd2ec4d9f4c94a45c94f6902b0 |
rust-timer
commented
Aug 16, 2018
Success: Queued e895c391336eabdd2ec4d9f4c94a45c94f6902b0 with parent 5db71db, comparison URL. |
BurntPizza
commented
Aug 17, 2018
Looks like it's ready for r+ |
dtolnay
commented
Aug 17, 2018
Thanks @scottmcm, I hadn't seen that thread. @alexcrichton can you tell whether any of the downsides of |
@dtolnay |
alexcrichton
commented
Aug 17, 2018
dtolnay
commented
Aug 17, 2018
Thanks, we'll remove all the ones on generic functions. r? @dtolnay |
BurntPizza
commented
Aug 17, 2018
Done. I'd like to check perf again, just to be sure. |
kennytm
commented
Aug 17, 2018
@bors try |
bors
commented
Aug 17, 2018
⌛ Trying commit 1540e8c with merge 4c76652fddb127b9ed67aa60a665ab1d37f0e97f... |
bors
commented
Aug 17, 2018
☀️ Test successful - status-travis |
kennytm
commented
Aug 17, 2018
@rust-timer build 4c76652fddb127b9ed67aa60a665ab1d37f0e97f |
rust-timer
commented
Aug 17, 2018
Success: Queued 4c76652fddb127b9ed67aa60a665ab1d37f0e97f with parent f34933b, comparison URL. |
Ah-ha! Interesting. Looks too consistently worse to e noise. |
alexcrichton
commented
Aug 20, 2018
@bors: r+ Ok I'm gonna go ahead and approve this because the functions tagged for inlining here are "obvious candidates for inlining". While it's true that not all the performance was recovered from inlining everything I think this is a good baseline to start from. I would personally prefer further analysis to figure out which functions actually need to be inlined instead of inlining all of them, which may be possible through diffing perf runs with everything inlined and without everything inlined (hottest functions at the top are likely the candidates to be inlined). I suspect you're right in that LLVM just actually needs an extra hint for some of the functions here to inline them. |
bors
commented
Aug 20, 2018
📌 Commit 1540e8c has been approved by |
…xcrichton Mark libserialize functions as inline Got to thinking: "what if that big pile of tiny functions isn't inlining as it should?" So a few `replace-regex` later the local perf run says this: <details>  </details> Not huge, but still a win, which is interesting. Want to verify with the real perf run, but I understand there's a backlog. I didn't notice any increase in compile time or binary sizes for rustc/libs.
Rollup of 17 pull requests Successful merges: - #53030 (Updated RELEASES.md for 1.29.0) - #53104 (expand the documentation on the `Unpin` trait) - #53213 (Stabilize IP associated constants) - #53296 (When closure with no arguments was expected, suggest wrapping) - #53329 (Replace usages of ptr::offset with ptr::{add,sub}.) - #53363 (add individual docs to `core::num::NonZero*`) - #53370 (Stabilize macro_vis_matcher) - #53393 (Mark libserialize functions as inline) - #53405 (restore the page title after escaping out of a search) - #53452 (Change target triple used to check for lldb in build-manifest) - #53462 (Document Box::into_raw returns non-null ptr) - #53465 (Remove LinkMeta struct) - #53492 (update lld submodule to include RISCV patch) - #53496 (Fix typos found by codespell.) - #53521 (syntax: Optimize some literal parsing) - #53540 (Moved issue-53157.rs into src/test/ui/consts/const-eval/) - #53551 (Avoid some Place clones.) Failed merges: r? @ghost
bors
commented
Aug 21, 2018
@bors retry r- |
Got to thinking: "what if that big pile of tiny functions isn't inlining as it should?"
So a few
replace-regexlater the local perf run says this:Details
I didn't notice any increase in compile time or binary sizes for rustc/libs.