[commit: containers] master: Define Map.{union, difference, intersection}WithKey using mergeWithKey. (5810f06)
Paolo Capriotti
p.capriotti at gmail.com
Thu Jul 19 21:13:15 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/containers
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/5810f064f1270688ebdcc7055545f3140f3aa5b2
>---------------------------------------------------------------
commit 5810f064f1270688ebdcc7055545f3140f3aa5b2
Author: Milan Straka <fox at ucw.cz>
Date: Sat Apr 28 16:36:31 2012 +0200
Define Map.{union,difference,intersection}WithKey using mergeWithKey.
The resulting implementations are approximately 40-50% faster, although
for some input data the performance is worse. This happens
* in unionWithKey, if the data are disjunct: 15% slowdown
* in differenceWithKey, as now we recurse over the first tree and not
the second. The slowdown happens also only for disjunct data: 30%.
See the SetOperations benchmark for yourself if you are interested.
Data/Map/Base.hs | 84 ++--------------------------------------------------
Data/Map/Strict.hs | 68 ++----------------------------------------
2 files changed, 6 insertions(+), 146 deletions(-)
Diff suppressed because of size. To see it, use:
git show 5810f064f1270688ebdcc7055545f3140f3aa5b2
More information about the Cvs-libraries
mailing list