Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue with Tomcat #66

Open
lujiajing1126 opened this issue Oct 23, 2020 · 2 comments
Open

Performance issue with Tomcat #66

lujiajing1126 opened this issue Oct 23, 2020 · 2 comments

Comments

@lujiajing1126
Copy link

lujiajing1126 commented Oct 23, 2020

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.

@pavolloffay
Copy link
Collaborator

Could you please point us to the code in this repo that uses this API? Is it in the extractor?

@lujiajing1126
Copy link
Author

Could you please point us to the code in this repo that uses this API? Is it in the extractor?

In the TextMap implementation,

Enumeration<String> headerNamesIt = httpServletRequest.getHeaderNames();
while (headerNamesIt.hasMoreElements()) {
String headerName = headerNamesIt.nextElement();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants