alda-lang / alda-core

The core machinery of Alda
80 stars 26 forks source link

Improve parsing time #18

Closed daveyarwood closed 3 years ago

daveyarwood commented 7 years ago

Moved from https://github.com/alda-lang/alda/issues/208.

Some work was done on this (https://github.com/alda-lang/alda/issues/238, https://github.com/alda-lang/alda/issues/240) with good results.

@aengelberg noted that the part-parser in alda.parser appears to be the primary bottleneck, so it's possible that we could see even better performance by optimizing that grammar.

daveyarwood commented 7 years ago

I think #20 is the answer to our woes. I'm seeing significant improvement in parse times in development.

It might be a while before we can release a version of Alda featuring the new streaming parser, but at least it's coming down the pipe at some point.

I think we should keep this issue open until we have a release of Alda where we can confirm in some way that parse times are no longer problematic.

EDIT 1/25/18: The streaming parser has been included in releases for a good while now.

semi-automatique commented 6 years ago

For me, performance improvement always starts from a suite of repeatable tests you can use to compare each new solution.

Would you like to have some performance regression tests for Alda parser? I dont know yet what kind of automated tests you have, but I could develop something specifically for the parser performance at my snail pace :).

I saw your Benchmarks in #37. I think it is a good baseline. Do you have a script to do those measurements? I never worked with clojure, so I would learn from it if you have one. Just give me some hints about where to look and start, and I will do something. For example, where are regression tests and how do I run those?

daveyarwood commented 6 years ago

Hi @semi-automatique, thanks for offering to help!

The benchmarks are run as part of the automated test suite. To run it:

That will run the entire test suite, including the benchmarks. To run the benchmarks alone, you can specify the namespace: boot test -n alda.examples-test.

semi-automatique commented 6 years ago

Thanks for the quick answer. I know what I will learn this weekend ;).

daveyarwood commented 3 years ago

Alda v2's parser beats the pants off of the Alda v1 parser. Scores are parsed on the order of microseconds. :sunglasses:

Closing this, as Alda v2 will be released soon :crossed_fingers: