Friday, October 30, 2015

Parsing JavaScript with Esprima vs ANTLR

My original thought is that, the compilation for ANTLR 4 Esmascript (I am using C# target)
should be faster than Esprima

It turns out that it is not.

I use jQuery.Mobile 1.4.2 to experiment:
ANTLR 4 makes use of 1 minute,
Esprima only makes use of 100 milliseconds.

Esprima is much faster than ANTLR 4.

Not only I have observed this, I have found some complaints of the speed of ANTLR 4 for JavaScript by other people:!msg/antlr-discussion/AUN7BLSDIzo/KG5MQ95Us9gJ

If you are gonna decide which to use, I am here to save your time: choose Esprima.