File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 3232 bInsert,
3333 bDelete,
3434 bUnion,
35+ bUnions,
3536 bIntersection,
3637 bDifference
3738 ],
@@ -263,6 +264,17 @@ bUnionEqual =
263264 where
264265 b size = bench (show size) . whnf (\ m -> HM. union m m)
265266
267+ bUnions :: Benchmark
268+ bUnions = bgroup " unions"
269+ [ bgroup'WithSizes sizes " Bytes" setupBytes b,
270+ bgroup'WithSizes sizes " Int" setupInts b
271+ ]
272+ where
273+ sizes = filter (>= 10 ) defaultSizes
274+ b size = bench (show size) . whnf (\ ms -> HM. unions ms)
275+ setupBytes s gen = replicateM 10 (genBytesMap (s `div` 10 ) gen)
276+ setupInts s gen = replicateM 10 (genBytesMap (s `div` 10 ) gen)
277+
266278-- TODO: For the "overlap" and "equal" cases, it would be interesting to
267279-- have separate benchmarks both with and without shared subtrees,
268280-- so we can make use of pointer equality.
You can’t perform that action at this time.
0 commit comments