[commit: containers] master: Define Map.{union, difference, intersection}WithKey using mergeWithKey. (5810f06)

Paolo Capriotti <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.libraries
Message-ID <[email protected]>
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 <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.