Use pure elm for laziness#184
Conversation
|
Original approach: New approach: |
|
I don't know if you're interested in various browsers, but I ran the benchmark in everything installed on my system at the moment: https://gist.github.com/tgecho/ddeed4e4e4cee32ba2cf6476bcf67671 Can do some IE/Edge later if it's of any use. I imagine V8 (because of node) is the focus right now? |
|
@tgecho Great, thank you! I think just confirming that it is more performant on other people's machines is the most important thing. From your results, it looks consistently faster across the board! good stuff |
|
Ran the benchmarks on my old laptop: https://gist.github.com/drathier/bc282ab8e40726c7e15901073ffd2d1d |
|
Nice! The performance gains make my worries go away. I'll clean this up for review, move those packages to elm-community, then we can merge and be ready for 0.19 😄 |
|
What's the status of this? Will is result in a MAJOR change? |
|
@mgold Haven't had time to focus on this yet. Do we want a release with this before the 0.19 alpha? If so I'll prioritize this |
|
As I understand it, this should be a @eeue56 I'd love to release this pre-0.19, both for the perf improvement and so we can confirm there are no issues with it ahead of time. (That way if we hit issues post-0.19, we can rule out this change as a possible culprit since it'll already have been working in 0.18.) |
|
Okidoki, I'll try to look into it this week |
79d995c to
37f13b4
Compare
346ae7b to
b01f483
Compare
|
This is now ready to merge |
|
Wonderful, thank you @eeue56! 😻 |
What
This PR does a few things:
Why
In theory, I believe that memoization is actually harmful to large test suites with in terms of memory and performance as a result. As elm-test only visits each node once, there is no need for memoization. I discussed this with @mgold on Slack, who confirmed that this theory could be accurate.
What needs to happen before merging?
I need people to run the benchmarks! As we can't currently run elm-benchmark on node, it would be very useful to have some information on how the benchmarks perform in different browsers (and therefore different GC techniques). My first comment after this PR will be the results that I got, which showed an improvement across the board for the pure-Elm version.
To test:
benchmarks/new.htmlin a browserbenchmarks/old.htmlin a browserFuture changes
The initial gain over the old approach is decent, but not by a magnitude. If we can confirm that this approach is faster, then there are a couple of optimizations I can do to further improve these results.