Performance benchmark
Opened this issue · 2 comments
Many thanks for your useful library.
I really like the structure, testing and documentation that comes with it. I however tested its performance against a few other implementations and found it to be rather slow in comparison to best in class ones:
gaspardpetit/base64#11
I understand performance may not be the main target for this library but it may be helpful to mention the banchmark results in the README.
On a related note, seeing the performance of modp_b64, I adapted their approach and created this using some c++20 features:
https://github.com/tvercaut/base64/blob/modpb64xover/include/base64.hpp
I would benefit from a nicer API and maintenance perks but I thought it could be relevant to share.
Hey @tvercaut ,
Thank you very much for including this library into that base64 benchmark project.
Indeed, performance was not the goal for this project, as it was written for a blog post I did a while back. Unfortunately, having more optimisations generally means the code becomes harder to read, so I developed it initially with that in mind.
Saying that, this repository got way more attention than I anticipated, and every now and then someone suggests improvements. I'm very glad for that!
I've been meaning to research different implementations and how I can improve this library without making it too difficult in terms of readability. One particular idea I've seen was implementing SIMD accelerated encoders/decoders, as the codebases I've seen didn't seem that "bloated".
I'll take a closer look at your implementation and will try and wrap my head around it, maybe we could work together to make something that beats other implementations out there?
Thanks. I won't have much time to look into this unfortunately as the solution I have so far is good enough for me. That said, there is an interesting accelerated implementation here:
https://github.com/lemire/fastbase64
It would be neat to get a well-tested c++ header-only version of it available somewhere.
There is also another option but it's GPL licensed which is an issue for me:
https://github.com/powturbo/Turbo-Base64