avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leo Simons <leosim...@apache.org>
Subject RE: ContainerManager and Sub-containers
Date Wed, 05 Jun 2002 19:26:33 GMT
> > > However, for most people it is just quicker to do this:
> > > 
> > > manager.lookup (Generator.ROLE + "/fooo");
> > 
> > make sure you tell everyone you can influence not to! We 
> > really need that "best practices" stuff =)
> 
> It gets tiring.  Why not just not make it possible?

why, to improve the world, of course!

> Rewritten because all Requests were handled in the compose() method:

here it is: a-hah! Make it a contract that Request can only ever be
created during compose() (pre-init()) and there you go: no more misuse.

> > You think there are many cases where string creation or 
> > string hashing are the bottleneck for a system that needs 
> > performance. You propose to use a request object for the CM, 
> > basically a container for a long, to solve this. The request 
> > object is then retrieved, using string creation and string 
> > hashing, from the CM.
> 
> Not to meantion the protection that a Request from one container
> isn't guaranteed to work in another container.

ah. Something worth mentioning, that is =)

> > I think the bottleneck is usually elsewhere. I propose to 
> > leave the responsibility for optimisation outside of the 
> > ComponentManager interface.
> 
> Any time you call toString(), it is a very expensive routine.
> Called several times in the critical path, and it can easily
> account for 30% of your processing time.

I still think component lookup is usually not the bottleneck, the key
phrase being "critical path". This is perhaps because I know how to
write avalon-based software while avoiding these bottlenecks (without
knowing that I avoid anything), or don't know how to write software with
other bottlenecks, or perhaps because it really is uncommon for this
problem.

> > did I miss something?
> 
> Of course you did.  You are also missing the fact that pulling
> a component from an array is quicker than pulling one from a hash.
> You also are forgetting how hashes work.

Nah, just have never found them to be a problem. Missed two other points
though...

conclusion: Leo's seen the light and will not vote -1 =)

g'night,

- Leo



--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message