A JSON Parser was implemented using each of these Parsing Libraries (Generators/Combinators/DSLs):
Chevrotain Parsing DSL implementation
Parsimmon Parser Combinator implementation
ANTLR4 Parser Generator grammar -> generated code
Peggy Parser Generator grammar -> generated code
abandoned: PEG.js Parser Generator
grammar
->
generated
code
Jison parser Generator grammar -> generated code
Nearley Parser Generator grammar -> generated code with Moo Lexer
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.
Benchmarking is done using the benchmark.js library.
The entire source code for this benchmark can be found in this github repository.