Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 7a69e5f34b14d7fbe988a755c9cfa937 > files > 8

jiapi-manual-0.4.0-3.mga4.noarch.rpm

Here is a short comparison made between different
interceptor strategies.

Tests named tc? are for comparison. Intention of the tests is 
not not create accurate performance metrics. Just to get
an idea of the performance of jiapi interceptors.

Tests named i? are for interceptors.

We get some performance penalty when measuring execution
time because of the way time measurement has been arranged.
For the interceptor test, we also get the penalty of instrumentation,
which is approximately 100 ms / class. Added code to Foo.main(...),
that makes the same measurement, which gives ~500 ms better results.

InvokeInterceptor
=================

test1: Make a call to static method.
       Loop count: 100 000
       tc1: Natural call
       tc2: call with reflection
       tc3: call with reflection, Method cached
            This is a naive test, caching all the method/class[]/Object[].
            In real life, this is not very likely to occur.
       tc4: dynamic proxy
       tc5: InvokeInterceptor

-----------------------------
tc1   tc2   tc3   tc4   i1
28    605   45          1850(2350)
-----------------------------

       Test1 results show, that we are far from being where
       we want. We want to be closer to tc2, if not faster.
          a) we instument all the code inside the test loop
             - Class.forName(...) call could be pre-instrumented 
               into some variable.
          b) We can cache reflection method search in interceptor

Applied changes to instrumentation.
   - Applied reflection method search caching.
     Instead of passing method signature to interceptor, we 
     pass a key to cache(classname + methodname + signature)
          - Getting close:
-----------------------------
tc1   tc2   tc3   tc4   i1
28    605   45          830(1350)
-----------------------------