[RFC] "http-types" breakage / additions / rework
Vlix:
The main benefit, though, is that the new implementations should be as fast or faster than the current ones, and that the functions manipulating them will make it easier to not make mistakes. (the new
HeaderNamefor example is aByteArraywhich is 3x faster in making comparisons (i.e.(==)) than aByteString, which also speeds up lookups)
I would suggest not overly prioritising raw performance, usability and correctness are higher priorities here. Header parsing is rarely on the critical path for HTTP clients and servers. Since header name comparison does need to be case-insensitive direct memcmp()/strcmp() of byte arrays is not quite sufficient.
Since ShortByteString is just a thin wrapper around ByteArray, if that’s the path you’re taking, you should probably use those, with case-insensitive comparison as appropriate.
Discussion in the ATmosphere