New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimize small Getters #124
Comments
Advancing the buffer pointer was moved to the outer loop since that gave a large speedup. This was done a few years ago when the library switched to CPS. |
Yes, attoparsec encode |
Partial resolved in #125 , now the overhead is low enough to not be a practical problem, but it still screws some single combinator benchmarks, for example the one in scanner package(which is quite meaningless anyway). I think maybe we should document trade-offs of current approach somewhere, so that people won't mistakenly think binary is slow. Actually it's the fastest one in my benchmark. |
After some profiling, i came to the conclusion that current running logic is too complex, in order to support
bytesRead
, we have twoDecoder
type, the overhead ofrunGetIncremental
is noticeable when the getter is small(around 100ns compare to cereal on my machine).This gives binary a disadvantage in various benchmarks, since lots of benchmark just focus on a single combinator, the overhead of running it render this kind of benchmarks meaningless.
There're cases we do need running small getters, but i haven't really need
bytesRead
yet. So let's find a way to improvebytesRead
, or remove it ?The text was updated successfully, but these errors were encountered: