AsciiString::cached is not sanitizing the provided String to match the Latin content into its byte[].
Right now this translate into output errors, but not any functional bug (as far as I can tell), but it prevents using the cached String, while available, to speedup common operations, as explained in https://github.com/netty/netty/pull/13747/files#r1435842167
A typical usage is while users have String-based API (eg for JaxRS,...) wrapping the Netty http headers map and they have to perform any lookup:
- a fresh new AsciiString::hashCode(String) computation is performed (which we cannot save)
- the found (if any) AsciiString is compared against the provided String using char-per-char comparisons
The latter operation could be made way faster if the AsciiString::string is a trusted version of the AsciiString content, enabling using String::contentEquals and intimately vectorized/bound-check free equality.
The same approach could be used similarly for the ignore case equality check, leveraging any provided String intrinsic.
Reactions are currently unavailable
AsciiString::cached is not sanitizing the provided String to match the Latin content into its byte[].
Right now this translate into output errors, but not any functional bug (as far as I can tell), but it prevents using the cached String, while available, to speedup common operations, as explained in https://github.com/netty/netty/pull/13747/files#r1435842167
A typical usage is while users have String-based API (eg for JaxRS,...) wrapping the Netty http headers map and they have to perform any lookup:
The latter operation could be made way faster if the AsciiString::string is a trusted version of the AsciiString content, enabling using String::contentEquals and intimately vectorized/bound-check free equality.
The same approach could be used similarly for the ignore case equality check, leveraging any provided String intrinsic.