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

Reduce string allocations while parsing #2

Merged
merged 1 commit into from Apr 17, 2021
Merged

Conversation

zz85
Copy link
Contributor

@zz85 zz85 commented Feb 18, 2021

During benchmarkings, pemfile parsing can be seen to be spending
much time in b64buf.push_str() in flamegraphs. Setting a capacity
on the base64 stringbuffer shows about 10%-25% improvements in
the microbenchmarks

(eg. from 5.7688 us to 4.5753 us for tests/data/certificate.chain.pem)

During benchmarkings, pemfile parsing can be seen to be spending
much time in b64buf.push_str() in flamegraphs. Setting a capacity
on the base64 stringbuffer shows about 10%-25% improvements in
the microbenchmarks
@ctz ctz merged commit f68646c into rustls:main Apr 17, 2021
@ctz
Copy link
Member

ctz commented Apr 17, 2021

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants