From c2542c5b4d881facd86b31ca8f266ec92548fdf9 Mon Sep 17 00:00:00 2001 From: Michael Wayne Goodman Date: Wed, 25 Mar 2020 11:03:09 +0800 Subject: [PATCH] Add table to README --- README.md | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index dbaa3be..8871656 100644 --- a/README.md +++ b/README.md @@ -10,22 +10,34 @@ each implementation. Each implementation must be: * **Plausible** -- it only uses expected (e.g., documented) parser features -## Tasks Performed - -The following tasks are included: - -- [JSON](tasks/json.md) -- [Arithmetic](tasks/arithmetic.md) - - -## Libraries Tested - -The following parsing libaries have implementations for the tasks: - -- [Lark](https://github.com/lark-parser/lark) -- [pe](https://github.com/goodmami/pe) -- [pyparsing](https://github.com/pyparsing/pyparsing/) -- [stdlib](https://docs.python.org/3/) (Python 3 standard library modules) +## Implementations + +This table lists the tasks performed and the libraries benchmarked. An +empty cell indicates that there is no implementation for that library +(yet; contributions welcome!). The stdlib implementation is held as +the baseline and the timing numbers are a ratio to that baseline +(e.g., 19.3 means it is 19.3 times slower than the baseline). Bold +numbers are the fastest non-baseline implementation. + +| Implementation | Algorithm | [JSON] | [Arithmetic] | +| -------------- | ----------------- | ----------: | -----------: | +| [stdlib] | handwritten | 1.0 | 1.0 | +| [Lark] | [LALR] | 53.0 | **19.3** | +| [parsimonious] | [Rec. Desc.] | 116.2 | -- | +| [pe] | [Rec. Desc.] | **30.7** | 22.2 | +| [pyparsing] | [Rec. Desc.] | 161.9 | -- | + +[stdlib]: https://docs.python.org/3/ +[Lark]: https://github.com/lark-parser/lark +[parsimonious]: https://github.com/erikrose/parsimonious +[pe]: https://github.com/goodmami/pe +[pyparsing]: https://github.com/pyparsing/pyparsing/ + +[JSON]: tasks/json.md +[Arithmetic]: tasks/arithmetic.md + +[LALR]: https://en.wikipedia.org/wiki/LALR_parser +[Rec. Desc.]: https://en.wikipedia.org/wiki/Recursive_descent_parser ## Setup