Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

foldl without materializing a list #136

Closed
matthewleon opened this issue Jan 17, 2018 · 2 comments
Closed

foldl without materializing a list #136

matthewleon opened this issue Jan 17, 2018 · 2 comments

Comments

@matthewleon
Copy link
Contributor

solves #134

This gives over a 10x speed improvement on larger maps (compare branch https://github.com/matthewleon/purescript-maps/tree/foldl-bench):

before

foldl: midsize map (10000)
mean   = 24.36 ms
stddev = 1.59 ms
min    = 22.57 ms
max    = 31.34 ms
foldl: big map (1000000)
mean   = 3.90 s
stddev = 143.96 ms
min    = 3.75 s
max    = 4.25 s

after

foldl: midsize map (10000)
mean   = 2.32 ms
stddev = 485.38 μs
min    = 2.04 ms
max    = 5.29 ms
foldl: big map (1000000)
mean   = 249.78 ms
stddev = 64.46 ms
min    = 226.67 ms
max    = 433.12 ms
@hdgarrood
Copy link
Contributor

Nice! Did you mean to open a PR?

@matthewleon
Copy link
Contributor Author

ugh, moving this to a PR, not an issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants