diff --git a/README.md b/README.md index 242f37f..a18192f 100644 --- a/README.md +++ b/README.md @@ -64,21 +64,21 @@ while the numbers below 1.0 demonstrate performance loss. | | 2 | 4 | 8 | 16 | 32 | 64 | 128 | | --- | --: | --: | --: | --: | --: | --: | --: | -| `hashbrown::HashMap` | 16.12 | 3.47 | 2.34 | 1.24 | 0.51 | 0.26 | 0.12 | -| `indexmap::IndexMap` | 13.98 | 6.07 | 4.28 | 2.26 | 1.15 | 0.57 | 0.27 | -| `linear_map::LinearMap` | 2.22 | 0.68 | 0.61 | 0.56 | 0.48 | 0.60 | 0.49 | -| `linked_hash_map::LinkedHashMap` | 26.38 | 7.67 | 5.18 | 3.24 | 1.46 | 0.77 | 0.35 | -| `litemap::LiteMap` | 4.97 | 1.48 | 1.19 | 0.86 | 0.46 | 0.29 | 0.18 | +| `hashbrown::HashMap` | 11.12 | 2.44 | 1.63 | 0.98 | 0.39 | 0.17 | 0.07 | +| `indexmap::IndexMap` | 13.00 | 5.83 | 3.20 | 1.97 | 0.76 | 0.33 | 0.16 | +| `linear_map::LinearMap` | 1.98 | 0.62 | 0.61 | 0.61 | 0.44 | 0.41 | 0.43 | +| `linked_hash_map::LinkedHashMap` | 36.84 | 11.39 | 4.83 | 3.01 | 1.52 | 0.70 | 0.33 | +| `litemap::LiteMap` | 1.97 | 1.10 | 0.84 | 0.71 | 0.41 | 0.26 | 0.19 | | `micromap::Map` 👍 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | -| `nohash_hasher::BuildNoHashHasher` | 12.07 | 3.58 | 2.72 | 1.01 | 0.48 | 0.25 | 0.11 | -| `rustc_hash::FxHashMap` | 12.06 | 3.34 | 2.25 | 1.36 | 0.48 | 0.25 | 0.12 | -| `std::collections::BTreeMap` | 22.61 | 4.80 | 3.38 | 2.49 | 1.22 | 0.60 | 0.35 | -| `std::collections::HashMap` | 18.61 | 5.67 | 4.02 | 2.24 | 1.13 | 0.56 | 0.26 | -| `tinymap::array_map::ArrayMap` | 2.00 | 2.32 | 2.15 | 2.26 | 2.28 | 2.30 | 2.01 | +| `nohash_hasher::BuildNoHashHasher` | 11.46 | 2.34 | 1.69 | 0.62 | 0.28 | 0.12 | 0.06 | +| `rustc_hash::FxHashMap` | 11.85 | 2.27 | 1.70 | 0.71 | 0.27 | 0.13 | 0.06 | +| `std::collections::BTreeMap` | 30.43 | 4.81 | 2.90 | 2.42 | 1.06 | 0.48 | 0.26 | +| `std::collections::HashMap` | 21.49 | 9.85 | 4.48 | 2.14 | 0.87 | 0.66 | 0.26 | +| `tinymap::array_map::ArrayMap` | 1.50 | 1.87 | 2.19 | 2.72 | 2.63 | 2.55 | 2.47 | The experiment [was performed](https://github.com/yegor256/micromap/actions/workflows/benchmark.yml) on 25-04-2023. There were 1000000 repetition cycles. -The entire benchmark took 352s. +The entire benchmark took 159s. diff --git a/rebuild_benchmark.sh b/rebuild_benchmark.sh index 1ea23b7..11e213a 100755 --- a/rebuild_benchmark.sh +++ b/rebuild_benchmark.sh @@ -11,6 +11,7 @@ sed -E -i 's/\[dev-dependencies\]//g' Cargo.toml micromap="micromap::Map" capacities="2 4 8 16 32 64 128" cycles=1000000 +first=$(echo ${capacities} | cut -f1 -d' ') rm -rf target/benchmark mkdir -p target/benchmark @@ -33,7 +34,7 @@ lapsed=$SECONDS echo -n " --: |" done echo '' - maps=$(cut -f 1 target/benchmark/2.out) + maps=$(cut -f 1 target/benchmark/${first}.out) for map in ${maps}; do echo -n "| \`${map}\`" if [ "${map}" == "${micromap}" ]; then