Closed klapaucius closed 6 months ago
That's probably expected:
https://github.com/Bodigrim/tasty-bench/blob/bb8810e3ca2d9752c4cf080f528eee3f96186074/src/Test/Tasty/Bench.hs#L1449-L1453
For some reason GHC optimizer does not get that aggressive with criterion
harness, but that's a matter of luck. I think it would be nice to change
-fvhfind :: Int -> VH.FrozenDictionary V.Vector Int V.Vector Int -> IO Int
-fvhfind n ht = return $ go 0 0 where
+fvhfind :: Int -> VH.FrozenDictionary V.Vector Int V.Vector Int -> Int
+fvhfind n ht = go 0 0 where
and then
- , bench "vector-hashtables (frozen)" $ nfIO (fvhfind n fh) ]
+ , bench "vector-hashtables (frozen)" $ nf (fvhfind n) fh ]
Well, this works. Thanks.
the same benchmarks ran using
criterion
https://github.com/klapaucius/vector-hashtables/blob/2dc4c0dc2d9471bec8f1d1b8edd161fcc78250fc/bench/Main.hs#L52