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

byte to string unsafe conversion in fasthttpadaptor ConvertRequest method #1375

Merged
merged 5 commits into from Sep 15, 2022

Conversation

mstrYoda
Copy link
Contributor

I changed the code to prevent string allocation by using unsafe conversion.

I wrote a benchmark test against changes.

Before:

image

After unsafe conversion:

image

fasthttpadaptor/request.go Show resolved Hide resolved
fasthttpadaptor/request.go Outdated Show resolved Hide resolved
@mstrYoda mstrYoda requested review from erikdubbelboer and Aoang and removed request for erikdubbelboer and Aoang September 14, 2022 18:19
Copy link
Collaborator

@erikdubbelboer erikdubbelboer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix lint failing.

@erikdubbelboer erikdubbelboer merged commit 40eec0b into valyala:master Sep 15, 2022
@erikdubbelboer
Copy link
Collaborator

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