Skip to content
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

Performance benchmark #126

Open
tvercaut opened this issue Feb 19, 2024 · 2 comments
Open

Performance benchmark #126

tvercaut opened this issue Feb 19, 2024 · 2 comments

Comments

@tvercaut
Copy link

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.

@matheusgomes28
Copy link
Owner

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?

@tvercaut
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants