Jaro

Results 167 comments of Jaro

ping @simonpj @pdownen @lukemaurer (I couldn't find Zena Ariola's github account if she even has one)

Oh, that sounds right. Now I feel silly for missing that. To be much more concrete. Take for example the [Quickhull](https://github.com/haskell/vector/blob/master/vector/benchmarks/Algo/Quickhull.hs) benchmark. Before [my changes](https://github.com/haskell/vector/pull/448) it takes 55.7 ms and...

Maybe it is some kind of cross-function case of case optimization that is lacking. After reducing an example to just a `V.map (* 2) . V.filter (> 10)` I get...

Here's a standalone reproducer: https://gist.github.com/noughtmare/f979c0fc9eed30abcd0849d19cf0f746 with the interesting core here: https://gist.github.com/noughtmare/f979c0fc9eed30abcd0849d19cf0f746#file-all-dump-simpl-L2737-L2794 Commands you can run: ``` wget https://gist.githubusercontent.com/noughtmare/f979c0fc9eed30abcd0849d19cf0f746/raw/858db7da16a5ba542148d794655057bed33f88b3/All.hs ghc -package ghc-prim -package primitive -O2 -ddump-simpl -dusppress-all -dno-suppress-type-signatures -ddump-to-file All.hs ```

If I translate the produced core back to Haskell: ```haskell module T where import Control.Monad.Primitive import Data.Primitive.Array import System.IO.Unsafe (unsafePerformIO) data Step s a = Yield a s | Done...

I did try increasing the max simplifier iterations which did not help. But now I've rewritten it using the lower level unboxed operations: ```haskell {-# LANGUAGE MagicHash #-} {-# LANGUAGE...

I think it is time to open a proper GHC issue for this, so I've done that: https://gitlab.haskell.org/ghc/ghc/-/issues/22227

Good news! I have been able to manually implement the "loopification" optimization that GHC is missing (see [this WIP merge request of GHC](https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9089)) with https://github.com/haskell/vector/pull/448/commits/cfaf0d4b0102b294784378bc3d77e6c7ceb2407f. Now almost all benchmarks are...

I've now reached the point that all benchmarks are (approximately) equal or faster, see https://github.com/haskell/vector/pull/448#issuecomment-1299110013.

@lehins > If I understand correctly the proper speed up is only observed with the [ghc patch](https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9089) No, I've manually implemented the optimization that GHC would do with that patch....