patch applied (packages/containers): Change the worker/wrapper to explicitly pass arguments.

Ian Lynagh igloo at earth.li
Fri Nov 12 17:09:12 EST 2010


Sat Oct 16 12:57:57 PDT 2010  Milan Straka <fox at ucw.cz>
  * Change the worker/wrapper to explicitly pass arguments.
  
  As the benchmarking showed, it is not a good idea to create
  closures in the worker/wrapper transformation, as the captured
  arguments of the enclosing function have to be allocated on the
  heap. It is better to explicitly pass the arguments on the stack.
  This saves memory and add no time penalty if the arguments are
  the first arguments of recursive function (GHC refrains from
  needless copying).
  
  The worker is often strict in some arguments. I did not want
  to use BangPatterns, so I used macros to indicate strictness.
  If majority thinks BangPatters are fine, I will gladly change it.

    M ./Data/IntMap.hs -85 +101
    M ./Data/IntSet.hs -34 +45
    M ./Data/Map.hs -139 +165
    M ./Data/Set.hs -45 +55

View patch online:
http://darcs.haskell.org/cgi-bin/darcsweb.cgi?r=packages/containers;a=darcs_commitdiff;h=20101016195757-7b66e-8cc141a04c7747851758f1f133a05ebd30cd7de7.gz


More information about the Cvs-libraries mailing list