forked from cockroachdb/swiss
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A swiss.Map will now rehash-in-place if there are a significant number of tombstones that can be reclaimed by doing so. This dramatically improves the worst case scenarios for the load-factor which could actually lead runaway growth of the map. name old load-factor new load-factor delta StringMap/avgLoad,n=10/swissMap/PutDelete-10 0.67 ± 0% 0.67 ± 0% ~ (all equal) StringMap/avgLoad,n=83/swissMap/PutDelete-10 0.24 ±66% 0.33 ± 0% +38.03% (p=0.033 n=10+10) StringMap/avgLoad,n=671/swissMap/PutDelete-10 0.16 ± 0% 0.33 ± 0% +100.00% (p=0.000 n=8+10) StringMap/avgLoad,n=5375/swissMap/PutDelete-10 0.14 ±41% 0.33 ± 0% +135.36% (p=0.000 n=10+10) StringMap/avgLoad,n=86015/swissMap/PutDelete-10 0.16 ± 0% 0.33 ± 0% +99.94% (p=0.000 n=10+10) Int64Map/avgLoad,n=10/swissMap/PutDelete-10 0.53 ±39% 0.46 ±45% ~ (p=0.656 n=10+10) Int64Map/avgLoad,n=83/swissMap/PutDelete-10 0.33 ± 0% 0.33 ± 0% ~ (all equal) Int64Map/avgLoad,n=671/swissMap/PutDelete-10 0.16 ± 0% 0.33 ± 0% +100.00% (p=0.000 n=10+10) Int64Map/avgLoad,n=5375/swissMap/PutDelete-10 0.11 ±43% 0.33 ± 0% +185.77% (p=0.000 n=10+10) Int64Map/avgLoad,n=86015/swissMap/PutDelete-10 0.16 ± 0% 0.33 ± 0% +99.94% (p=0.000 n=10+10) Performance vs Go's builtin map remains excellent. name old time/op new time/op delta StringMap/avgLoad,n=10/Map/Get-10 9.46ns ± 4% 8.43ns ± 1% -10.89% (p=0.000 n=10+9) StringMap/avgLoad,n=83/Map/Get-10 10.9ns ± 7% 8.9ns ±12% -18.45% (p=0.000 n=10+10) StringMap/avgLoad,n=671/Map/Get-10 15.4ns ± 3% 9.1ns ± 3% -40.98% (p=0.000 n=10+10) StringMap/avgLoad,n=5375/Map/Get-10 25.8ns ± 1% 9.3ns ± 1% -63.83% (p=0.000 n=10+9) StringMap/avgLoad,n=86015/Map/Get-10 30.4ns ± 1% 10.8ns ± 1% -64.49% (p=0.000 n=9+9) Int64Map/avgLoad,n=10/Map/Get-10 5.05ns ± 2% 4.87ns ± 1% -3.60% (p=0.000 n=10+10) Int64Map/avgLoad,n=83/Map/Get-10 5.27ns ± 5% 5.29ns ±12% ~ (p=0.912 n=10+10) Int64Map/avgLoad,n=671/Map/Get-10 6.14ns ± 4% 5.35ns ± 3% -12.85% (p=0.000 n=10+10) Int64Map/avgLoad,n=5375/Map/Get-10 18.4ns ± 4% 5.7ns ± 2% -68.94% (p=0.000 n=10+10) Int64Map/avgLoad,n=86015/Map/Get-10 23.9ns ± 0% 6.9ns ± 0% -71.35% (p=0.000 n=10+8) name old time/op new time/op delta StringMap/avgLoad,n=10/Map/PutDelete-10 25.4ns ± 6% 23.7ns ± 8% -6.43% (p=0.004 n=10+10) StringMap/avgLoad,n=83/Map/PutDelete-10 31.4ns ± 7% 24.3ns ±12% -22.66% (p=0.000 n=10+10) StringMap/avgLoad,n=671/Map/PutDelete-10 45.4ns ± 3% 24.9ns ± 4% -45.21% (p=0.000 n=10+10) StringMap/avgLoad,n=5375/Map/PutDelete-10 56.7ns ± 1% 24.7ns ± 2% -56.44% (p=0.000 n=10+10) StringMap/avgLoad,n=86015/Map/PutDelete-10 60.8ns ± 1% 31.6ns ± 2% -48.03% (p=0.000 n=9+9) Int64Map/avgLoad,n=10/Map/PutDelete-10 18.0ns ± 3% 17.1ns ±34% ~ (p=0.095 n=9+10) Int64Map/avgLoad,n=83/Map/PutDelete-10 19.8ns ± 3% 14.6ns ±12% -26.11% (p=0.000 n=9+9) Int64Map/avgLoad,n=671/Map/PutDelete-10 27.2ns ± 3% 15.2ns ± 6% -44.02% (p=0.000 n=10+10) Int64Map/avgLoad,n=5375/Map/PutDelete-10 44.5ns ± 0% 16.9ns ± 3% -62.10% (p=0.000 n=7+10) Int64Map/avgLoad,n=86015/Map/PutDelete-10 50.8ns ± 0% 21.0ns ± 1% -58.65% (p=0.000 n=10+10)
- Loading branch information
1 parent
f479bc5
commit ca8f8ac
Showing
3 changed files
with
239 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.