diff options
| author | kennytm <kennytm@gmail.com> | 2018-02-14 18:28:39 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2018-02-14 19:54:00 +0800 |
| commit | ce89c3de760a402fcffb63c6914e4d8314a69250 (patch) | |
| tree | 9eafff1d9b6d8c9e35df38aed6e7aafa3c5f085d /src/rustllvm/RustWrapper.cpp | |
| parent | 6436c44201711280615b84ed07f387c2d3fb10ea (diff) | |
| parent | e034dddb32cd9814d9f71bb2b444f9863fba2dfc (diff) | |
| download | rust-ce89c3de760a402fcffb63c6914e4d8314a69250.tar.gz rust-ce89c3de760a402fcffb63c6914e4d8314a69250.zip | |
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.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
