On 12/14/2014 02:25 AM, [email protected] wrote:
I have recently been working on making it possible to achieve 60 fps animations 
in Elm (a compile-to-js functional language http://elm-lang.org/)
programs backed by canvas.

I posted about progress and limitations on the Elm list

https://groups.google.com/forum/#!topic/elm-discuss/ErEx6IZNNAQ

and I thought some of the material might be interesting to the Mozilla JS 
implementers.

Summarizing the relevant parts:

1. Elm produces kind of a lot of garbage. This seems to make it impossible to 
animate even simple scenes reliably at 60 fps in Firefox, but Chrome
is doing a pretty good job.

2. You can compare the performance of my sample Elm program across browsers 
here: http://jsbin.com/cusahisozo

3. I also made a stripped down pure JS canvas animation and garbage collection 
benchmark. It has the advantage of having simple JS source code and
tunable parameters that determine the rate of garbage allocation, but its 
disadvantage is that the garbage load is totally artificial, and might
not be a good model for real programs. You can try it here (click "run with js" 
in the top right if it doesn't auto run):

http://jsbin.com/puzojazapi/1/edit?js,output

If you're interested, please see the description of the benchmark and a summary 
of my findings in the post on the Elm list linked above. I'll
refrain from reproducing it all here. My overall conclusion is that Chrome 
seems to have significantly lower maximum GC pauses for this workload.

4. Thanks for adding Timeline to the dev tools. It's totally sweet!

I can see that there is and has been a lot of hard work on improving the 
Firefox GC. I spent some time perusing open issues, and I read Nicholas
Nethercote's post about Generational GC landing earlier this year 
https://blog.mozilla.org/nnethercote/2014/03/31/generational-gc-has-landed/.
Anyway, my point is that I'm not trying to troll the Mozilla folks about the v8 
GC being ahead along some axis--I just wanted to report a case
study that might be a useful data point.

Is there anything here that I should open a ticket about?



Please file a bug and attach a testcase.

Looks like your testcase creates tons of garbage, given that it ends up
triggering TOO_MUCH_MALLOC GC all the time. Looks very unusual to me.
I see ~30ms GCs (and 1-2ms CCs occasionally)

Any idea why Elm is so super garbage heavy?
Sounds like it needs some optimizations.


-Olli
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to