quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

Faster lookup of Vertx HTTP headers

Open franz1981 opened this issue 1 year ago • 3 comments

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 known AsciiString, which equals/hashCode computations are optimized by Netty
  • the latter because we use String::split which create useless intermediate array objects (and Strings) and doesn't make use of faster and intrinsified methods to find the comma/colon delimiters (which instead can be done using String::indexOf)

franz1981 avatar Jul 31 '23 07:07 franz1981

/cc @brunobat (opentelemetry), @radcortez (opentelemetry)

quarkus-bot[bot] avatar Jul 31 '23 07:07 quarkus-bot[bot]

I'm parking this here till we get some reliable estimation of overhead of the mentioned util methods

franz1981 avatar Jul 31 '23 07:07 franz1981

Thanks @franz1981 !

brunobat avatar Jul 31 '23 08:07 brunobat