[commit: packages/containers] cleaned_bugfix394, master, merge-doc-target, merge-fixes-5.9, merge-restrict-fix-5.8, revert-408-bugfix_394: Speed up Data.Sequence.splitAt and zipWith (aaf5408)

git at git.haskell.org git at git.haskell.org
Mon Apr 17 21:41:04 UTC 2017


Repository : ssh://git@git.haskell.org/containers

On branches: cleaned_bugfix394,master,merge-doc-target,merge-fixes-5.9,merge-restrict-fix-5.8,revert-408-bugfix_394
Link       : http://git.haskell.org/packages/containers.git/commitdiff/aaf54086fda866eb0f3b36607884b984a37962d4

>---------------------------------------------------------------

commit aaf54086fda866eb0f3b36607884b984a37962d4
Author: David Feuer <David.Feuer at gmail.com>
Date:   Wed May 18 21:45:29 2016 -0400

    Speed up Data.Sequence.splitAt and zipWith
    
    Previously, `splitAt` returned a lazy pair, and was pretty much
    lazy throughout. Now it's about as strict as it's allowed to be.
    
    Avoid allocating anything extra when splitting at or before the
    beginning of a sequence.
    
    Fix misplaced bang annotation (my fault).
    
    Hand-inline and reduce the splitting of the top of the tree. This
    avoids a separate cons step at the end, saving some time when
    splitting small sequences. This is particularly helpful for
    zip performance.
    
    Note: `zip` performance is, for some reason, rather sensitive to
    how the inliner handles `deepL`. I don't know why. I also don't
    really know how to fix it. Splitting in general is rather complicated
    and hard to follow. It would be nice to fix that.
    
    Rewrite `take` and `drop` so they don't build the parts of the
    tree they don't actually use. Previously, they were written
    using `splitAt`.
    
    Use custom left and right views for `FingerTree`s. This was a side
    effect of something I thought I wanted to do, but it's a good idea
    anyway.


>---------------------------------------------------------------

aaf54086fda866eb0f3b36607884b984a37962d4
 Data/Sequence.hs             | 513 ++++++++++++++++++++++++++++++++++---------
 Data/Utils/BitQueue.hs       |   2 +
 changelog.md                 |   3 +
 tests/bitqueue-properties.hs |   2 +
 4 files changed, 415 insertions(+), 105 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc aaf54086fda866eb0f3b36607884b984a37962d4


More information about the ghc-commits mailing list