rust/library/std/src
bors a0035916e0 Auto merge of #83093 - the8472:smaller-instant-hammer, r=Amanieu
where available use AtomicU{64,128} instead of mutex for Instant backsliding protection

This decreases the overhead of backsliding protection on x86 systems with unreliable TSC, e.g. windows. And on aarch64 systems where 128bit atomics are available.

The following benchmarks were taken on x86_64 linux though by overriding `actually_monotonic()`, the numbers may look different on other platforms

```
# actually_monotonic() == true
test time::tests::instant_contention_01_threads                   ... bench:          44 ns/iter (+/- 0)
test time::tests::instant_contention_02_threads                   ... bench:          44 ns/iter (+/- 0)
test time::tests::instant_contention_04_threads                   ... bench:          44 ns/iter (+/- 0)
test time::tests::instant_contention_08_threads                   ... bench:          44 ns/iter (+/- 0)
test time::tests::instant_contention_16_threads                   ... bench:          44 ns/iter (+/- 0)

# 1x AtomicU64
test time::tests::instant_contention_01_threads                   ... bench:          65 ns/iter (+/- 0)
test time::tests::instant_contention_02_threads                   ... bench:         157 ns/iter (+/- 20)
test time::tests::instant_contention_04_threads                   ... bench:         281 ns/iter (+/- 53)
test time::tests::instant_contention_08_threads                   ... bench:         555 ns/iter (+/- 77)
test time::tests::instant_contention_16_threads                   ... bench:         883 ns/iter (+/- 107)

# mutex
test time::tests::instant_contention_01_threads                   ... bench:          60 ns/iter (+/- 2)
test time::tests::instant_contention_02_threads                   ... bench:         770 ns/iter (+/- 231)
test time::tests::instant_contention_04_threads                   ... bench:       1,347 ns/iter (+/- 45)
test time::tests::instant_contention_08_threads                   ... bench:       2,693 ns/iter (+/- 114)
test time::tests::instant_contention_16_threads                   ... bench:       5,244 ns/iter (+/- 487)
```

Since I don't have an arm machine with 128bit atomics I wasn't able to benchmark the AtomicU128 implementation.
2021-08-20 19:06:46 +00:00
..
backtrace Add Frames iterator for Backtrace 2021-01-23 11:56:33 -06:00
collections Auto merge of #87843 - kornelski:try_reserve, r=m-ou-se 2021-08-12 01:16:22 +00:00
env std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
error std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
f32 More lerp tests, altering lerp docs 2021-06-13 14:00:15 -04:00
f64 More lerp tests, altering lerp docs 2021-06-13 14:00:15 -04:00
ffi Auto merge of #86879 - YohDeadfall:stabilize-vec-shrink-to, r=dtolnay 2021-08-08 19:37:02 +00:00
fs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
io Auto merge of #87820 - elichai:patch-2, r=kennytm 2021-08-09 08:19:19 +00:00
lazy Upgrade wasm32 image to Ubuntu 20.04 2021-02-06 13:05:56 +01:00
net Auto merge of #87329 - sunfishcode:sunfishcode/io-safety, r=joshtriplett 2021-08-20 11:00:55 +00:00
num rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
os Fix doc test failures on Windows. 2021-08-19 16:15:29 -07:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path add Ord tests for Path comparisons 2021-07-06 20:20:16 +02:00
prelude Move asm! and global_asm! to core::arch 2021-07-18 18:30:58 -04:00
process Test that env_clear works on Windows 2021-06-24 09:32:24 +01:00
sync Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
sys Factor out a common RawFd/AsRawFd/etc for Unix and WASI. 2021-08-19 13:27:19 -07:00
sys_common I/O safety. 2021-08-19 12:02:39 -07:00
thread removed references to parent/child from std::thread documentation 2021-08-07 11:33:18 -04:00
time fix tests on wasm targets that have 32bit time_t and don't have threads 2021-08-20 20:34:23 +02:00
alloc.rs Rename rterr to rtprintpanic 2021-05-19 15:52:09 +02:00
ascii.rs Convert many files to intra-doc links 2020-09-02 17:37:40 -04:00
backtrace.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
env.rs Fix environment variable getter docs 2021-08-17 00:37:52 -07:00
error.rs Rollup merge of #82179 - mbartlett21:patch-5, r=joshtriplett 2021-06-15 17:40:03 +09:00
f32.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
f64.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
fs.rs Add comments about impls for File, TcpStream, ChildStdin, etc. 2021-08-19 12:02:40 -07:00
keyword_docs.rs Fix a few misspellings. 2021-06-25 13:18:56 -07:00
lazy.rs Constified Default implementations 2021-08-17 07:15:54 +00:00
lib.rs Remove the #![feature(io_safety)] from lib.rs. 2021-08-19 12:02:40 -07:00
macros.rs bump bootstrap compiler to 1.55 2021-08-01 11:19:24 -04:00
num.rs postpone stabilizaton by one release 2021-06-22 10:20:56 +01:00
panic.rs Move UnwindSafe, RefUnwindSafe, AssertUnwindSafe to core 2021-07-30 10:42:15 -07:00
panicking.rs rustc: Fill out remaining parts of C-unwind ABI 2021-08-03 07:06:19 -07:00
path.rs Auto merge of #86898 - the8472:path-cmp, r=dtolnay 2021-08-20 05:00:45 +00:00
primitive_docs.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
process.rs Add comments about impls for File, TcpStream, ChildStdin, etc. 2021-08-19 12:02:40 -07:00
rt.rs Change entry point to 🛡️ against 💥 💥-payloads 2021-06-19 11:46:56 +03:00
time.rs where available use 64- or 128bit atomics instead of a Mutex to monotonize time 2021-08-13 00:18:46 +02:00