Fork me on GitHub
#clojure-dev
<
2016-01-12
>
ghadi03:01:59

yay, map merge performance improved greatly. > Map Sizes = 1000 197us => 117us > Map Sizes = 64 10.95us => 6.6us > Map Sizes = 3 628ns => 671ns slight regression

ghadi03:01:59

boo for real world results that regress

ragge11:01:15

did you look at other smaller sizes? like 2...9?

ghadi16:01:14

just looked at those sizes... further improvements possible. I switched from testing merge to testing conj, because that's a change I made in the code... Results:

BEFORE
benching bigmap merge
Evaluation count : 323520 in 60 samples of 5392 calls.
             Execution time mean : 187.027055 µs
benching medium merge
Evaluation count : 5668320 in 60 samples of 94472 calls.
             Execution time mean : 10.659091 µs
benching small merge
Evaluation count : 148000560 in 60 samples of 2466676 calls.
             Execution time mean : 396.300486 ns

AFTER

benching bigmap merge
Evaluation count : 389940 in 60 samples of 6499 calls.
             Execution time mean : 157.765536 µs
benching medium merge
Evaluation count : 7740120 in 60 samples of 129002 calls.
             Execution time mean : 7.775295 µs
benching small merge
Evaluation count : 110361780 in 60 samples of 1839363 calls.
             Execution time mean : 537.015274 ns

ghadi16:01:28

as you can see small map conjs are slower.

bronsa16:01:09

@ghadi: is it an array-map/hash-map difference maybe?

ghadi16:01:42

also def a benchmarking issue because conj does not use transients

ghadi16:01:22

And I don't want to override APersistentMap/cons inside PHM or PAM...