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

base64: encode without snprintf: a 29x speedup #10026

Closed
wants to merge 7 commits into from

Conversation

bagder
Copy link
Member

@bagder bagder commented Dec 3, 2022

For speed

Test setup

https://gist.github.com/bagder/baee5725e09a5977ef5b0471e2b3334f

Measurements

Best out three runs on my machine.

Old code: 5m55.291
New code: 12.254 seconds

A 28.99 times speedup.

lib/base64.c Show resolved Hide resolved
@Bouska
Copy link

Bouska commented Dec 5, 2022

You can remove line 41, we don't need the curl_printf.h header anymore.

@bagder bagder changed the title base64: encode without using snprintf base64: encode without using snprintf: a 29x speedup Dec 5, 2022
@bagder bagder changed the title base64: encode without using snprintf: a 29x speedup base64: encode without snprintf: a 29x speedup Dec 5, 2022
@bagder bagder closed this in fc02a78 Dec 5, 2022
@bagder bagder deleted the bagder/base64-no-snprintf branch December 5, 2022 10:34
@MonkeybreadSoftware
Copy link
Contributor

Great work.

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

Successfully merging this pull request may close these issues.

None yet

4 participants