Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[wtp-dev] Yet another possibke JavaScript parser for JSDT

Google Closure Compiler (https://github.com/google/closure-compiler) has parser that can be used in JSDT.

It's Rhino based, supports ES6, has configurable source mode (ES3, ES5, ES5_STRICT, ES6, ES6_STRICT, ES6_TYPED) and
"tolerant".

It's slower than shift and nashorn, but its java nature, project activity, "tolerance" and estree output makes it a good
alternative to esprima.

It's hard to say what is better to wait for ES6 support in nashorn or use closure :-), but I hope this information is
useful.

Below are benchmarks:

# Run complete. Total time: 00:55:48

Benchmark                           Mode  Cnt   Score   Error  Units
ClosureParser.testAngular125       thrpt  200  35,088 ? 0,140  ops/s
ClosureParser.testJQM142           thrpt  200  31,035 ? 0,136  ops/s
EsprimaWithNashorn.testAngular125  thrpt  200  16,322 ? 0,102  ops/s
EsprimaWithNashorn.testJQM142      thrpt  200  15,296 ? 0,177  ops/s
NashornParser.testAngular125       thrpt  200  63,632 ? 0,392  ops/s
NashornParser.testJQM142           thrpt  200  66,194 ? 0,325  ops/s
ShiftJava.testAngular125           thrpt  200  75,205 ? 0,481  ops/s
ShiftJava.testJQM142               thrpt  200  79,151 ? 0,493  ops/s


-- 
Eugene Melekhov



Back to the top