Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » Blueprint OSGi proxy call overhead
Blueprint OSGi proxy call overhead [message #660536] Fri, 18 March 2011 23:16 Go to next message
David Erickson is currently offline David EricksonFriend
Messages: 21
Registered: April 2010
Junior Member
Hi I am wondering if there is a way to 'turn down' the overhead being imposed by imported OSGi services, ie using Spring DM 2.0.0.M1 I compared the overhead of calling an object defined in the local Spring containter versus one imported from another bundle via the service registry and found the following:

-Callstack from the imported bundle is 23 function calls deep
-Avg function call time from a direct Spring reference: 6.5ns
-Avg function call time from a Spring proxied service registry reference: 352.3ns
-Ratio: 54:1

I'd really like to break my application up into more pieces and be more dynamic, however I can't put anything that gets called with any kind of frequency across this divide given the current performance hit. Is there a fix for this, or any plans to address this issue? I realize I didn't test the Blueprint milestone release yet, but I figured someone here could weigh in on if anything has changed between DM2 and this release.

Thanks,
David
Re: Blueprint OSGi proxy call overhead [message #660541 is a reply to message #660536] Sat, 19 March 2011 00:52 Go to previous messageGo to next message
David Erickson is currently offline David EricksonFriend
Messages: 21
Registered: April 2010
Junior Member
For comparison purposes I tested the latest version of Aries (0.3) on Equinox 3.7M6:

-Call stack depth: 9
-Average proxy call time: ~72ns

This is a pretty big gap between the two pieces of software.
Re: Blueprint OSGi proxy call overhead [message #660542 is a reply to message #660536] Sat, 19 March 2011 01:07 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
Would you mind sharing your testing approach or maybe your test bundles? Would be very interested in it.
Re: Blueprint OSGi proxy call overhead [message #660545 is a reply to message #660542] Sat, 19 March 2011 03:40 Go to previous messageGo to next message
David Erickson is currently offline David EricksonFriend
Messages: 21
Registered: April 2010
Junior Member
Hi Dmitry-
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

Re: Blueprint OSGi proxy call overhead [message #660779 is a reply to message #660545] Mon, 21 March 2011 15:02 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
Thanks for the info. I will try to replicate the test today.

One thing to mention - spring dm does a lot of things outside just publishing proxies. that is TCCL management and etc.

Does Aries do the same? Does it apply any kind of interceptors on the service at all?
Re: Blueprint OSGi proxy call overhead [message #660844 is a reply to message #660779] Mon, 21 March 2011 22:48 Go to previous message
David Erickson is currently offline David EricksonFriend
Messages: 21
Registered: April 2010
Junior Member
Unknown to be honest, I just picked it because it was the only other blueprint impl that I know of. But to be honest, if your not using these features, they are only slowing things down. In particular I'm not using them and would like to turn them off Smile
Previous Topic:Gemini JPA graduates!
Next Topic:Gemini DBAccess Graduation
Goto Forum:
  


Current Time: Sat Apr 20 01:39:04 GMT 2024

Powered by FUDForum. Page generated in 0.03031 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top