JavaScript Parsing Libraries Benchmark

A JSON Parser was implemented using each of these Parsing Libraries (Generators/Combinators/DSLs):

These are hand-built JSON parsers to compare against generic generators/libraries/DSLS The browser's JSON.parse() for comparison. [implementation] Oboe JSON Parser for comparison [implementation] Substack Jsonify JSON Parser for comparison [implementation]

The JSON Grammar was used because it is simple to implement, simple to compare and is often already available as a sample grammar for most parsing tools.

The input sample for the benchmark is a ~1,000 lines JSON file generated by json-generator.

See the benchmark methodology for details on what is being tested and how.

The Chevrotain and Antlr Libraries can either produce a Parse Tree (with Visitor / listener) or use embedded actions in the grammar. Thus they are measured in both scenarios ("-PT" means Parse Tree variant).

Benchmarking is done using the benchmark.js library.

The entire source code for this benchmark can be found in this github repository.

Run