jengebr commented on PR #770:
URL: https://github.com/apache/tomcat/pull/770#issuecomment-2448111787

   This complexity led me to try a fallback plan, which can be faster: if the 
method has zero parameters, retrieve the Method by name.  This works because 
there is no confusion about parameter types.  Example:
   
   ```
           if (paramTypes.length == 0) {
               try {
                   Method method = clazz.getMethod(methodName, paramTypes);
                   return method;
               } catch (NoSuchMethodException | SecurityException e) {
                   // fall through to broader, slower logic
               }
           }
   ```
   
   Test data shows this is 2x faster than caching for the fast case, and has no 
appreciable impact on the others.  That's an excellent outcome for my 
application, not sure how you feel about the general case?


-- 
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

Reply via email to