haskell-hvr / uuid

A Haskell library for creating, printing and parsing UUIDs
http://hackage.haskell.org/package/uuid
61 stars 38 forks source link

toString got slower #57

Closed phadej closed 3 years ago

phadej commented 3 years ago
Benchmark                  old       old2              master             master2          
HashSet making             0.376e-5  0.378e-5  +0.66%  0.438e-5  +16.65%  0.433e-5  +15.31%
Set making                 0.424e-5  0.430e-5  +1.29%  0.399e-5   -6.03%  0.397e-5   -6.37%
conversion/fromASCIIBytes  2.541e-7  2.254e-7 -11.30%  2.258e-7  -11.13%  2.160e-7  -14.99%
conversion/fromByteString  0.684e-7  0.748e-7  +9.42%  0.762e-7  +11.46%  0.748e-7   +9.38%
conversion/fromString      0.476e-6  0.492e-6  +3.39%  0.488e-6   +2.52%  0.515e-6   +8.31%
conversion/fromText        0.777e-6  0.809e-6  +4.05%  0.284e-6  -63.44%  0.265e-6  -65.85%
conversion/fromWords       0.609e-8  0.612e-8  +0.49%  0.633e-8   +3.98%  0.613e-8   +0.65%
conversion/toASCIIBytes    0.344e-7  0.305e-7 -11.23%  0.327e-7   -4.83%  0.385e-7  +11.91%
conversion/toByteString    1.058e-7  1.075e-7  +1.67%  1.058e-7   +0.07%  1.065e-7   +0.73%
conversion/toString        3.037e-7  3.077e-7  +1.34%  6.320e-7 +108.12%  6.394e-7 +110.57%
conversion/toText          0.550e-6  0.514e-6  -6.58%  0.050e-6  -90.84%  0.055e-6  -89.94%
conversion/toWords         0.898e-8  0.890e-8  -0.93%  0.864e-8   -3.77%  0.844e-8   -5.96%
storable/peek              2.936e-8  2.842e-8  -3.21%  2.925e-8   -0.38%  2.823e-8   -3.85%
storable/poke              0.509e-8  0.524e-8  +2.97%  0.492e-8   -3.23%  0.498e-8   -2.14%
testing/compare differ     0.718e-8  0.731e-8  +1.78%  0.694e-8   -3.39%  0.718e-8   -0.02%
testing/compare same       0.834e-8  0.867e-8  +3.94%  0.713e-8  -14.52%  0.725e-8  -13.10%
testing/eq differ          0.698e-8  0.707e-8  +1.37%  0.678e-8   -2.76%  0.679e-8   -2.72%
testing/eq same            0.679e-8  0.687e-8  +1.18%  0.707e-8   +4.14%  0.703e-8   +3.53%
testing/null nil           0.417e-8  0.419e-8  +0.48%  0.328e-8  -21.50%  0.325e-8  -22.14%
testing/null nil2          0.490e-8  0.481e-8  -1.90%  0.413e-8  -15.84%  0.418e-8  -14.64%
testing/null non-nil       0.353e-8  0.347e-8  -1.89%  0.291e-8  -17.70%  0.278e-8  -21.26%
Geometric mean             0.465e-7  0.464e-7  -0.26%  0.395e-7  -15.07%  0.397e-7  -14.62%

old is 953aef9e4b2d5800e7f4289c954cc8d30fa06fed

Otherwise change to Word64 (and other changes) are overall improvement.

Also a picture so you can see highlights

Screenshot from 2021-02-16 23-35-19

My machine is noisy as you can see from differences of two runs, so +-10% is fine (on individual benchmark)