Bogdanp / elm-ast

A parser for Elm in Elm.
http://bogdanp.github.io/elm-ast/example/
BSD 3-Clause "New" or "Revised" License
143 stars 21 forks source link

Better multiline performance #82

Closed baransu closed 7 years ago

baransu commented 7 years ago

Attempt to fix #80. Updates also tests to newest elm-test version.

Main optimisation was reordering term and expression order based on popularity. It reduced time a lot. Other changes were related to creating more GC friendly Elm because this is the real problem. There is test in tests/Multiline.elm which parses 11 arguments, every in new line. It takes around 20s on MacBook Pro (down from ~96s). I don't thing we can squash more than that without changing new line parsing logic.

Please try to add Test.only to tests/Multiline.elm to run only performance test and measure parsing time. Really counting on your feedback.