Conversation
| // zero is unavailable because wrapping occurs | ||
| move_end(v) |
There was a problem hiding this comment.
Note that this arm just kinda gave up before; it never even considered whether putting it next to start might be better.
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
302d83d to
a146c66
Compare
|
It helps to remember to |
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
Currently we pick "weird" numbers like `1114112` for `None::<char>`. While that's not *wrong*, it's kinda *unnatural* -- a human wouldn't make that choice. This PR instead picks `-1` for thinge like `None::<char>` -- like clang's `WEOF` -- and `None::<bool>` and such. Any enums with more than one niched value (so not `Result` nor `Option`) remain as they were before.
a146c66 to
09df883
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (ed76e05): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary 1.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.9%, secondary -4.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.2%, secondary -0.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 491.618s -> 493.312s (0.34%) |
|
Wow, those results are way better than I expected 😅 Seems pretty clearly a net win to me. |
|
r? @chenyukang rustbot has assigned @chenyukang. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
seems a good perf improvement, lgtm, but need other's review. |
Currently we pick "weird" numbers like
1114112forNone::<char>. While that's not wrong, it's kinda unnatural -- a human wouldn't make that choice.This PR instead picks
-1for thinge likeNone::<char>-- like clang'sWEOF-- andNone::<bool>and such.Any enums with more than one niched value (so not
ResultnorOption) remain as they were before. Also we continue to use0when that's possible ---1is only preferred when zero isn't possible.Inspired when someone in discord posted an example like this https://rust.godbolt.org/z/W94s9qdYW and I thought it was odd that we're currently picking
-9223372036854775808to be the value to store to mark anOption<Vec<_>>asNone. (Especially since that needs an 8-byte immediate on x64, and writing-1is only a 4-byte immediate.)