https://bz.apache.org/bugzilla/show_bug.cgi?id=69552

--- Comment #9 from John Engebretson <jeng...@amazon.com> ---
Here's the stack trace that accounts for 90% of the impact:

sun.nio.cs.UTF_8$Encoder.encodeBufferLoop
sun.nio.cs.UTF_8$Encoder.encodeLoop
java.nio.charset.CharsetEncoder.encode
java.nio.charset.CharsetEncoder.encode
java.nio.charset.Charset.encode
java.nio.charset.Charset.encode
org.apache.tomcat.util.buf.MessageBytes.toBytes
org.apache.tomcat.util.http.Parameters.processParameters
org.apache.tomcat.util.http.Parameters.handleQueryParameters
org.apache.catalina.core.ApplicationHttpRequest.mergeParameters
org.apache.catalina.core.ApplicationHttpRequest.parseParameters
org.apache.catalina.core.ApplicationHttpRequest.getParameter
com.amazon.core.platform.runtime.ThreadSafeRequestFilter$ThreadSafeRequestWrapper.getParameter
javax.servlet.ServletRequestWrapper.getParameter
javax.servlet.ServletRequestWrapper.getParameter
com.amazon.horizonte.servlet.io.MutableParametersHttpServletRequest.getParameter
javax.servlet.jsp.el.ImplicitObjectELResolver$ScopeManager$7.getAttribute
javax.servlet.jsp.el.ImplicitObjectELResolver$ScopeManager$7.getAttribute
javax.servlet.jsp.el.ImplicitObjectELResolver$ScopeMap.get
javax.el.MapELResolver.getValue
org.apache.jasper.el.JasperELResolver.getValue
org.apache.el.parser.AstValue.getValue
org.apache.el.parser.AstAbstractEmpty.getValue
org.apache.el.ValueExpressionImpl.getValue
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate
(org.apache.jsp.WEB_002dINF.<proprietary>_jsp._jspx_meth_c_005fif_005f0)|(org.apache.jsp.WEB_002dINF.<proprietary>_jsp._jspx_meth_c_005fif_005f0)

And here's the code for the relevant custom methods:

ThreadSafeRequestWrapper.getParameter:
  public synchronized String getParameter(String name) {
    return getRequest().getParameter(name);
  }

MutableParametersHttpServletRequest.getParameter
  public MutableParametersHttpServletRequest(HttpServletRequest request,
Map<String, String[]> parameters) {
    super(request);
    this.params = new HashMap<String, String[]>(parameters);
  }

  public String getParameter(String paramName) {
    if (params.containsKey(paramName)) {
      String[] values = params.get(paramName);
      return (values != null) && (values.length > 0) ? values[0] : null;
    } else {
      return super.getParameter(paramName);
    }
  }

Both JSP tags:

<c:if test="${not empty param.renderedContent}" >  

Both JSPs are called via several layers of <jsp:includes>, and one of the
upstream inclusions adds a <jsp:param> tag.  These particular JSPs are the
first place the params are read after the <jsp:param> tag and are the unlucky
trigger of parameter reparsing (ApplicationHttpRequest.parseParameters).

So the perf opportunity comes from eliminating this part of the re-parsing
work.

That's a lot of text, sorry, I hope it answers your questions.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to