rust/library/std
Tyler Mandry 29a946203a
Rollup merge of #75545 - eddyb:instant-sub-branchless, r=sfackler
std/sys/unix/time: make it easier for LLVM to optimize `Instant` subtraction.

This PR is the minimal change necessary to get LLVM to optimize `if self.t.tv_nsec >= other.t.tv_nsec` to branchless instructions (at least on x86_64), inspired by @m-ou-se's own attempts at optimizing `Instant` subtraction.

I stumbled over this by looking at the total number of instructions executed by `rustc -Z self-profile`, and found that after disabling ASLR, the largest source of non-determinism remaining was from this `if` taking one branch or the other, depending on the values involved.

The reason this code is even called so many times to make a difference, is that `measureme` (the `-Z self-profile` implementation) currently uses `Instant::elapsed` for its event timestamps (of which there can be millions).

I doubt it's critical to land this, although perhaps it could slightly improve some forms of benchmarking.
2020-08-14 20:07:16 -07:00
..
benches mv std libs to library/ 2020-07-27 19:51:13 -05:00
src Rollup merge of #75545 - eddyb:instant-sub-branchless, r=sfackler 2020-08-14 20:07:16 -07:00
tests mv std libs to library/ 2020-07-27 19:51:13 -05:00
build.rs std: Switch from libbacktrace to gimli 2020-07-28 16:34:01 -07:00
Cargo.toml Bump std's libc version to 0.2.74 2020-08-14 00:37:19 -07:00