example or tutorial for Zepto parser in attoparsec

143 views Asked by At

The title says it all: I look for examples or tutorial for Zepto parser in attoparsec.

I have a reasonably simple parser for a network protocol (BGP, as it happens), which runs reasonably quickly, but still significantly slower than 'C'. I've inlined, unboxed and benchmarked as well as I can, and now wonder whether there is anything more I can gain using the Zepto parser variant which my problem seems quite appropriate to.

1

There are 1 answers

1
Yuras On

Here is an example of Redis protocol parser using Zepto.

Note that attoparsec allows unbounded backtracking, it makes it inefficient for parsers that don't use backtracking. So moving to Zepto makes sense. You may want to evaluate also scanner and binary-parsers packages if you don't need backtracking, they may (or may not) be up to 3 times faster then attoparsec.