Performance issue with Tomcat
As is documented in the comments of MimeHeaders, each call of nextElement() has a complexity of O(n) with a comparison done with all previous elements to ensure the uniqueness.
Jetty has better performance since it uses HashSet to get a set of header keys.
I wonder if we could treat org.apache.catalina.connector.Request as a special case. A simple index-based iteration does improve the performance.
Could you please point us to the code in this repo that uses this API? Is it in the extractor?
Could you please point us to the code in this repo that uses this API? Is it in the extractor?
In the TextMap implementation,
https://github.com/opentracing-contrib/java-web-servlet-filter/blob/558145f517b37f2d066c7679a02324679d049e1b/opentracing-web-servlet-filter/src/main/java/io/opentracing/contrib/web/servlet/filter/HttpServletRequestExtractAdapter.java#L55-L57