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

Using optimized Vertx HTTP header names #37615

Merged
merged 1 commit into from Dec 11, 2023

Conversation

franz1981
Copy link
Contributor

@franz1981 franz1981 commented Dec 8, 2023

Another low hanging fruit: vertx AsciiStrings constant in Httpheaders have constant and cached case-insensitive hashcodes, which make them faster under pretty much any circumstances.

The benefit is to drop to ~0 the ~2.87% cost reported in plaintext with reactive routes at

image

Moving to contains bring another additional benefit: a reduced allocation pressure, because Vertx multimap's get force allocating a String out of AsciiString's value (which is the AsciiString::toString calls in the flamegrah).

The header matching cost of HeadersMultiMap::get0 instead (in AsciiString::contentEqualsIgnoreCase) depends by NOT using a const AsciiString header values.

Not a big, but ~3% less overall is sensible, especially because, looking a finer picture of encoding and sending back the response in the same test, it's relevant for 11.20% of the cost, on par of encoding the content in the buffer to be sent back (which is a small content, but still...).

image

@franz1981
Copy link
Contributor Author

@Sanne :P

@quarkus-bot
Copy link

quarkus-bot bot commented Dec 11, 2023

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

@gsmet gsmet merged commit d187563 into quarkusio:main Dec 11, 2023
20 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Dec 11, 2023
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

3 participants