|Re: Blueprint OSGi proxy call overhead [message #660545 is a reply to message #660542]
||Sat, 19 March 2011 03:40
| David Erickson
Registered: April 2010
The methodology is pretty simple, the test harness calls a function on an object that just increments its integer argument. This function is called via an instance created and wired inside the same container, and an instance that is created inside another bundle's container, published to the service registry, and consumed by a service reference from the test harness. The test harness starts the clock, calls the function 1000 times, then stops the clock. It then repeats the procedure 1000 times to get an average time it took to run the function 1000 times, then divides that average by 1000 to get an average execution time for the function.
The code is a bit messy, I threw it together just for the benchmark. You can increase the loops or initial calls, although it may overflow the long accumulator, and you'll have to use BigInteger/Decimal which I was lazy and didn't feel like doing. You can grab the code here: http://yuba.stanford.edu/~derickso/functionTest.tgz
Oh and to measure the call depth I just set a break point where the harness begins calling the osgi proxied object, then put a break point in the proxied object and hit play, when it broke I counted the stack between the two objects.
[Updated on: Sat, 19 March 2011 03:42]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02774 seconds