Skip to content

http: use toLowerCase in matchKnownFields

Remove a micro-optimization that is for the most part actively hurting performance.

  • for Content-Type, Content-Length & Proxy-Authorization (capitalized), the new version is about 10-15% slower
  • for content-type & content-length (lowercase), the new version is the same
  • for all others, the further down the list, the faster the new version is (from 10% to 100%)
  • for mixed case headers (or ones that are not on the list), the new version is about 200-400% faster

Based on my testing, it's clear that V8 has some optimizations in toLowerCase for strings that are already lower case as those all perform exceptionally well.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

http

Merge request reports

Loading