cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: Experimental lazy-loading in ECM++
Date Wed, 05 Jan 2005 21:11:01 GMT
Stefano Mazzocchi wrote:

> Sylvain Wallez wrote:
>> Hi all,
>> I (once again) did some refactoring in ECM++ to implement a 
>> lazy-loading strategy for components. Using this strategy, a 
>> component is loaded (including it's class) only when looked up. This 
>> heavily reduces Cocoon's initialization time.
>> Some quick measurement of the time spent in Cocoon.initialize() and 
>> Cocoon.process() for the first request on my laptop give the 
>> following numbers (in seconds):
>> - standard "load all" strategy : initialize - 13.6 / process - 4.4
>> - lazy loading strategy : initialize - 3.3 / process - 3.7
> swish, swish
> [sound of Stefano polishing his current hero plate with Sylvain's name 
> on top]


>> The purpose of this mode is to leverage the autocompiling 
>> classloader, by making it usable to automatically restart Cocoon 
>> whenever an automatically-compiled class is modified. We would then 
>> have the type-safety and IDE-friendlyness of Java combined with the 
>> hot-reload abilities of scripted languages.
>> This lazy mode is not activated by default. To use it, set 
>> JAVA_OPTIONS="-Dorg.apache.cocoon.core.LazyMode=true" before starting 
>> " servlet".
> Why not? Given the above speedup times, I would suggest we turn this 
> on by default, what do you think?

The drawback of lazy loading is that intializing all components performs 
some additionnal checks such as loading classes and setting up some 
component instances. So we may want to disable lazy loading on 
production systems so that such errors are raised earlier. Now 
considering the highly dynamic nature of Cocoon, such checks represent 
only a very small portion of what must be done to ensure that an 
application is ready for production...

>> ECM++ can be made even more lazy, so expect some more speedup soon.
> I have the polishing towel ready :-)

Kewl ;-)


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

View raw message