Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any benchmark comparison against cockroachdb's swiss map? #31

Open
kolinfluence opened this issue Apr 21, 2024 · 1 comment
Open

Any benchmark comparison against cockroachdb's swiss map? #31

kolinfluence opened this issue Apr 21, 2024 · 1 comment

Comments

@kolinfluence
Copy link

as titled

@ianwilkes
Copy link

I just did a bakeoff on my apple silicon (ARM), the results are wildly different! This is using cockroach's own benchmarks, cockroach on the left, dolthub on the right:

Iteration:
BenchmarkMapIter/impl=swissMap/t=Int/len=1048576-12                  4472918       2289718       -48.81%

Int64s:
BenchmarkMapGetHit/impl=swissMap/t=Int64/len=1048576-12              17.1          18.3          +6.83%
BenchmarkMapGetMiss/impl=swissMap/t=Int64/len=1048576-12             15.1          8.03          -46.96%
BenchmarkMapPutGrow/impl=swissMap/t=Int64/len=1048576-12             52900212      52104365      -1.50%
BenchmarkMapPutPreAllocate/impl=swissMap/t=Int64/len=1048576-12      20431517      19296885      -5.55%
BenchmarkMapPutReuse/impl=swissMap/t=Int64/len=1048576-12            18195871      14626880      -19.61%
BenchmarkMapPutDelete/impl=swissMap/t=Int64/len=1048576-12           35.1          83.2          +136.90%

Strings:
BenchmarkMapGetHit/impl=swissMap/t=String/len=1048576-12             40.3          35.4          -12.12%
BenchmarkMapGetMiss/impl=swissMap/t=String/len=1048576-12            21.7          11.5          -47.17%
BenchmarkMapPutGrow/impl=swissMap/t=String/len=1048576-12            99480000      97972653      -1.52%
BenchmarkMapPutPreAllocate/impl=swissMap/t=String/len=1048576-12     66451148      64990448      -2.20%
BenchmarkMapPutReuse/impl=swissMap/t=String/len=1048576-12           63804971      26531076      -58.42%
BenchmarkMapPutDelete/impl=swissMap/t=String/len=1048576-12          96.0          139           +44.45%

The "PutDelete" benchmark deletes each key before putting it back in the map, which is pretty weird, so unless you do a lot of deletes it looks like this library is the clear winner for the time being. Would love to see the same test run on Intel though.

Also implies there may be scope to improve the Delete method here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants