Parser tool is a real-time compiler and runtime engine for strongly typed PEG parsers

20 views
Skip to first unread message

Andrew Mezoni

unread,
May 10, 2021, 10:15:38 AM5/10/21
to Dart Misc
Parser tool contains libraries that allow you to create strongly typed PEG parsers. The tool contains a compiler that compiles a parser in real time and an engine to execute the compiled parsers.  

Advantages

- Strongly typed parsers
- Sufficiently high performance
- Allows you to debug the parser through tracing support with information about the parsing progress
- Expression notations are available during debugging
- Allows you to print out grammar

Disvantages

- Not as fast parsers as compared to parsers that compile directly into source code
- The debugging process is not so clear and convenient

Benchmarks

Parse 10 times: E:\prj\test_json\bin\data\citm_catalog.json
Dart JSON                 : k: 1.00, 96.88 MB/s, 170.01 ms (8.68%),
PEG2 general modified JSON: k: 2.06, 47.06 MB/s, 350.02 ms (17.87%),
PEG2 general classic JSON : k: 2.02, 48.02 MB/s, 343.02 ms (17.51%),
Tool with prediction JSON : k: 2.64, 36.68 MB/s, 449.03 ms (22.92%),
Petitparser JSON          : k: 11.52, 8.41 MB/s, 1959.11 ms (100.00%),

Parse 10 times: E:\prj\test_json\bin\data\twitter.json
Dart JSON                 : k: 1.00, 60.18 MB/s, 90.00 ms (5.03%),
PEG2 general modified JSON: k: 4.07, 14.80 MB/s, 366.02 ms (20.46%),
PEG2 general classic JSON : k: 1.61, 37.35 MB/s, 145.01 ms (8.11%),
Tool with prediction JSON : k: 2.28, 26.42 MB/s, 205.01 ms (11.46%),
Petitparser JSON          : k: 19.88, 3.03 MB/s, 1789.10 ms (100.00%),

An example of a JSON parser used in performance tests:



Reply all
Reply to author
Forward
0 new messages