IoC container performance issues

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

IoC container performance issues

Adriaan Joubert-3
Hi,

we hit some performance issues using the tapestry IoC. The problem is
that we have legacy apps where we do need to do a lot of registry
look-ups - takes a while to rewrite everything to have services
injected via constructors everywhere. In our particular case we have a
few hundred services and in one instance a static call was replaced
with a registry look-up and a call on the service. It turns out that a
registry look-up is rather slower than we expected.

A colleague has looked into this and says:

"We are having some performance issues with the getService() method in
the 'RegistryImpl' class. Looking at the source code it seems that there
are some linear list searches going on in there that could perhaps be
replaced by more efficient map lookups, if possible."

Has anybody looked into the performance of the IoC?

Thanks,

Adriaan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: IoC container performance issues

Howard Lewis Ship
The container is organized for functionality, not performance, with
service lookups because lookups normally occur once.

Suggestion: create a "lookup" service that has getters for all the
other keys services you want. Inject those other services into its
implementation. Obtain it from the Registry. Store it in a global and
use that for non-service code to gain access to IoC services.

On Mon, Nov 9, 2009 at 2:15 AM, Adriaan Joubert <[hidden email]> wrote:

> Hi,
>
> we hit some performance issues using the tapestry IoC. The problem is
> that we have legacy apps where we do need to do a lot of registry
> look-ups - takes a while to rewrite everything to have services
> injected via constructors everywhere. In our particular case we have a
> few hundred services and in one instance a static call was replaced
> with a registry look-up and a call on the service. It turns out that a
> registry look-up is rather slower than we expected.
>
> A colleague has looked into this and says:
>
> "We are having some performance issues with the getService() method in
> the 'RegistryImpl' class. Looking at the source code it seems that there
> are some linear list searches going on in there that could perhaps be
> replaced by more efficient map lookups, if possible."
>
> Has anybody looked into the performance of the IoC?
>
> Thanks,
>
> Adriaan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



--
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: IoC container performance issues

Adriaan Joubert-3
We'll do that. Thanks!

Adriaan

2009/11/9 Howard Lewis Ship <[hidden email]>:

> The container is organized for functionality, not performance, with
> service lookups because lookups normally occur once.
>
> Suggestion: create a "lookup" service that has getters for all the
> other keys services you want. Inject those other services into its
> implementation. Obtain it from the Registry. Store it in a global and
> use that for non-service code to gain access to IoC services.
>
> On Mon, Nov 9, 2009 at 2:15 AM, Adriaan Joubert <[hidden email]> wrote:
>> Hi,
>>
>> we hit some performance issues using the tapestry IoC. The problem is
>> that we have legacy apps where we do need to do a lot of registry
>> look-ups - takes a while to rewrite everything to have services
>> injected via constructors everywhere. In our particular case we have a
>> few hundred services and in one instance a static call was replaced
>> with a registry look-up and a call on the service. It turns out that a
>> registry look-up is rather slower than we expected.
>>
>> A colleague has looked into this and says:
>>
>> "We are having some performance issues with the getService() method in
>> the 'RegistryImpl' class. Looking at the source code it seems that there
>> are some linear list searches going on in there that could perhaps be
>> replaced by more efficient map lookups, if possible."
>>
>> Has anybody looked into the performance of the IoC?
>>
>> Thanks,
>>
>> Adriaan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]