cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ka-Lok Fung (JIRA)" <j...@apache.org>
Subject [jira] Created: (CXF-3261) JAX-RS: Performance improvement for JAXRSOutInterceptor.checkBufferingMode
Date Fri, 21 Jan 2011 02:37:44 GMT
JAX-RS: Performance improvement for JAXRSOutInterceptor.checkBufferingMode
--------------------------------------------------------------------------

                 Key: CXF-3261
                 URL: https://issues.apache.org/jira/browse/CXF-3261
             Project: CXF
          Issue Type: Improvement
    Affects Versions: 2.3.1
         Environment: JDK 1.6

            Reporter: Ka-Lok Fung
            Priority: Critical
             Fix For: 2.3.3


While profiling CXF's JAX-RS implementation in a multi-threaded scenario (10 threads simultaneously
hitting our JAX-RS CXF-based application, repeated for many iterations), we noticed that a
lot of time was spent inside JAXRSOutInterceptor.checkBufferingMode.

After examining the code we determined that the reason why was because InjectionUtils.invokeBooleanGetter
was explicitly invoking a method without checking whether or not the method exists. Because
the code relies on an exception to determine whether or not the method exists, it's a bit
expensive because creating Exceptions is expensive in Java.

Instead of just invoking the method and depending on NoSuchMethodException, can you check
to see if the method exists first before calling it? I do realize that it probably involves
iterating getMethods() but this should be more efficient than generating the Exception.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message