Closed ghost closed 4 years ago
I added a benchmark in master and parse_string
got quite a bit slower in this PR. After a bit of work, the version in this PR is now about 33% and allocates about 73% less on the example in the benchmark:
Branch | Time/Run | mWd/Run | mjWd/Run | Prom/Run |
---|---|---|---|---|
master | 22.71ms | 9.44Mw | 1.82Mw | 1.82Mw |
this PR | 15.71ms | 2.49Mw | 1.75Mw | 1.75Mw |
I just need to add a bit of doc and this will be good to go.
I added documentation. @rgrinberg and @mefyl could you try it in ocaml-lsp/dune-cache and give some feedback? The documentation is quite extensive, so hopefully it should be straightforward.
I'll make a 1.3 release after that.
This seems fine to me, but I'm not using csexp in LSP at the moment. So we'll have to wait a bit before feedback.
Alternative to #8. This PR proposes to add a direct parsing API (no functors involved) where the user can feed characters to the parser one by one. It is similar to the API of Parsexp.
It also fixes
input_opt
which couldn't returnNone
before.