Add vector version of mapAccumL that behaves like the list version
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing the referenced pull request 38 and its benchmark comparisons for the hand-rolled, mapM, and State-based versions. Trace how the list version's mapAccumL behavior maps to the vector API. Done means a vector version matches the list semantics and the chosen implementation has benchmarked fusion performance comparable to the hand-rolled version.
Written by the indexing model from the issue text.
Description
I've implemented a hand rolled version, and another two versions based on a combination of mapM and the lazy and strict versions of State monad.
https://github.com/haskell-works/hw-prim/pull/38
The benchmarks show that the hand rolled versions run two times faster than the lazy state monad version and 16 times faster than the strict state monad version.
I found the slow performance of the strict monad version most surprising.
I'm aware that the version that using mapM might enable fusion, however it is a fair bit slower than a hand rolled version that defeats fusion.
I would love to have a fusion-enabled version that runs as fast as the hand rolled version. Would that be possible?
- Dominant language
- Haskell
- Stars
- 401
- Forks
- 145
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from haskell/vector
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
enhancement tricorder
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
zip-archive-0.5 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
commercialhaskell/stackage#8124 · 1 comment ·
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 91/100
alunduil/alunduil-chezmoi#792 ·