rust/src/libstd
kennytm ce89c3de76
Rollup merge of #48035 - technicalguy:Early-exit-empty-hashmap-38880, r=arthurprs
Early exit for empty HashMap (issue #38880)

Addresses issue #38880 by checking if the HashMap is empty before computing the value of the hash.

Before (integer keys)
```
running 4 tests
test empty_once ... bench:          13 ns/iter (+/- 0)
test empty_100  ... bench:       1,367 ns/iter (+/- 35)
test exist_once ... bench:          14 ns/iter (+/- 0)
test exist_100  ... bench:       1,518 ns/iter (+/- 40)
```

After
```
running 4 tests
test empty_once ... bench:           2 ns/iter (+/- 0)
test empty_100  ... bench:         221 ns/iter (+/- 0)
test exist_once ... bench:          15 ns/iter (+/- 0)
test exist_100  ... bench:       1,515 ns/iter (+/- 92)
```

When the HashMap is not empty, the performance remains the same, and when it is empty the performance is significantly improved.
2018-02-14 19:54:00 +08:00
..
collections 38880 remove unnecessary self.table.size check 2018-02-13 20:25:10 +00:00
ffi Make wording around 0-cost casts more precise 2018-01-27 17:54:01 +01:00
io Correct a few stability attributes 2018-02-10 21:20:42 +00:00
net Deprecate std::net::lookup_host 2018-01-17 19:16:26 -08:00
os fix docs link 2018-02-06 09:26:15 -06:00
prelude Reexport -> re-export in prose and documentation comments 2018-01-15 13:36:53 -05:00
sync fix typo rwlock.rs 2018-01-10 08:03:10 +03:00
sys Rollup merge of #47912 - cuviper:glibc-stack-guard, r=alexcrichton 2018-02-04 23:28:57 +08:00
sys_common Use a range to identify SIGSEGV in stack guards 2018-01-31 11:41:29 -08:00
thread Update miri to rustc changes 2017-12-06 09:25:29 +01:00
ascii.rs Fix doc typo for is_ascii_graphic 2017-12-30 21:27:43 +00:00
build.rs Add proper library dependencies for libstd on CloudABI. 2017-12-29 09:33:26 +01:00
Cargo.toml Implement extensible syscall interface for wasm 2018-01-30 23:22:19 +00:00
env.rs Unimplement Send/Sync for ::env::{Args,ArgsOs,Vars,VarsOs} 2018-02-05 00:00:09 +01:00
error.rs Rename never_type_impls gate to never_type 2017-12-12 14:03:03 +08:00
f32.rs typo: correct endianess to endianness (this also changes function names!) 2018-02-11 00:56:24 +01:00
f64.rs typo: correct endianess to endianness (this also changes function names!) 2018-02-11 00:56:24 +01:00
fs.rs Rollup merge of #47999 - jaystrictor:master, r=Mark-Simulacrum 2018-02-05 01:20:56 +08:00
heap.rs Update miri to rustc changes 2017-12-06 09:25:29 +01:00
lib.rs Document std::os::raw. 2018-01-29 17:44:12 -05:00
macros.rs Fixed a typo in the compile_error docs 2018-01-08 16:35:06 -08:00
memchr.rs Fix inconsistent doc headings 2017-08-24 18:42:53 +02:00
num.rs Auto merge of #40706 - irfanhudda:doc-next-power-of-two, r=alexcrichton 2017-06-08 01:07:08 +00:00
panic.rs NonNull ended up landing in 1.25 2018-01-21 09:48:23 +01:00
panicking.rs We have Rust 1.25 now 2018-01-10 03:27:08 +01:00
path.rs Correct a few stability attributes 2018-02-10 21:20:42 +00:00
primitive_docs.rs Rename never_type_impls gate to never_type 2017-12-12 14:03:03 +08:00
process.rs add test checking that process::Command is Send 2018-01-26 08:21:58 -08:00
rt.rs Reexport -> re-export in prose and documentation comments 2018-01-15 13:36:53 -05:00
termination.rs Bump to 1.25.0 2018-01-04 07:21:22 -08:00
time.rs Move time::Duration to libcore 2018-01-29 18:16:43 -05:00