quarkus
quarkus copied to clipboard
Faster lookup of Vertx HTTP headers
In the OpenTelemetry benchmark (run by @barreiro and @brunobat ) I've spotted some memory and cpu waste around VertxUtil
related how we lookup for known HTTP headers and how we parse them:
- the former is using a common
String
literal instead of a constant knownAsciiString
, which equals/hashCode computations are optimized by Netty - the latter because we use
String::split
which create useless intermediate array objects (andString
s) and doesn't make use of faster and intrinsified methods to find the comma/colon delimiters (which instead can be done usingString::indexOf
)
/cc @brunobat (opentelemetry), @radcortez (opentelemetry)
I'm parking this here till we get some reliable estimation of overhead of the mentioned util methods
Thanks @franz1981 !