StudentGu opened a new pull request, #867: URL: https://github.com/apache/tomcat/pull/867
In org.apache.coyote.Request#getCharsetHolder, when charsetHolder.getName() returns null, parsing is performed repeatedly, resulting in unnecessary performance overhead. The following optimizations are proposed: 1. Initialize the org.apache.coyote.Request#charsetHolder member variable to null instead of CharsetHolder.EMPTY, so that null clearly indicates the unparsed state. 2. In getCharsetHolder, check if charsetHolder is null to determine whether parsing is needed, instead of checking charsetHolder.getName() == null. 3. Once charsetHolder is assigned (regardless of whether name is null), consider it parsed and avoid any further parsing. This avoids repeated parsing when charsetHolder.getName() is null, improving performance. Please ensure thread safety and that assignment semantics remain consistent during implementation. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org