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

perf(http): avoid per header alloc #14051

Merged
merged 1 commit into from
Mar 21, 2022

Conversation

AaronO
Copy link
Contributor

@AaronO AaronO commented Mar 20, 2022

When checking if header matches a "special" header (that impacts our body handling, etc...)

make_ascii_lowercase could also make sense here

Impact on throughput

Unfortunately there's a lot of variance in our tests and it's not fully formalized but I do observe a 1-3% improvement in throughput (sampled over 3 runs):

Before (1.20.1)
Requests/sec: 126285.80
Requests/sec: 127775.95
Requests/sec: 128875.33

After (this PR):
Requests/sec: 130615.10
Requests/sec: 129957.80
Requests/sec: 129056.16

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

Is there any measureable impact on performance?

@AaronO AaronO requested a review from bartlomieju March 21, 2022 10:35
@AaronO
Copy link
Contributor Author

AaronO commented Mar 21, 2022

Is there any measureable impact on performance?

Yes, there's a 1-3% improvement, I've discussed with @littledivy a bench that would bypass the OS' net stack & loadgen tool better suited to measuring http-efficiency & should have less variance.

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

lgtm

@AaronO AaronO merged commit 45ef3c9 into denoland:main Mar 21, 2022
@AaronO AaronO deleted the perf/http-avoid-per-header-alloc branch March 21, 2022 11:56
kitsonk pushed a commit to kitsonk/deno that referenced this pull request Mar 23, 2022
kitsonk pushed a commit that referenced this pull request Mar 24, 2022
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

4 participants