[Grok-dev] Neanderthal-sprint: Speeding up the Grok startup with zc.configuration

Lennart Regebro regebro at gmail.com
Mon Oct 1 11:07:18 EDT 2007


On 9/30/07, Martijn Faassen <faassen at startifact.com> wrote:
> Hey,
>
> I'm now in Germany in the hotel! I thought of another sprint topic: Grok
> startup time.
>
> It'd be quite interesting to see what we can do to increase startup time
> of Grok. Jim has made a package available called zc.configure that can
> be used to exclude ZCML from being loaded. This can, according to Jim,
> be used to cut startup time (and also test setup time) significantly.
>
> This is quite interesting - I'd really love it if Grok could start up a
> lot faster than it does now. There's also likely a lot of ZCML we can
> cut out (anything doing the ZMI for starters!).

Today me, Joachim Schmitz and Ahmet Toker tried to speed up the Grok
startup by excluding zcml that isn't used in Grok. Basically, we used
Jim Fultons new zc.configuration module to exclude browser modules
that are loaded in Zope3. It would obviously be better if the
separation between the functionality and the web pages used by the ZMI
was higher, so we didn't have to include things from the beginning,
but that's much harder work.

After a bit of work we had found around 20 zcml-files that could be
excluded without breaking the tests. That decreased the startup time
with about 10%. There are probably more modules to exclude, but it's
going to take a while to go through all of zope3 that way, and we
don't know how much faster it will be. There are no more than 100
modules all in all, and not all of them have a browser.zcml or browser
module. I doubt that we'll find more than 40 zcml all in all, which
could cut startup time with maybe 20% all in all, whoch s not very
impressive. When startup time already is in the single-seconds on a
reasonably modern computer, cutting off a couple of tenths, or maybe a
second, doesn't really seem worth the hassle and the risk of breaking
stuff.

And besides, Grok is currently just a couple of tenths slower than a
completely empty Zope2 site, and we know that what takes long when
starting Zope2 is not Zope2 itself, but the application. A typical
Plone 2.5 site takes 3 times as long as an empty Zope 2.9 site,
meaning that in real life with Grok even 30% speedup of Grok startup
might only mean 10% if you use a large application like a CMS. Is it
worth it?

The work we did can be found here:
http://svn.zope.org/grok/branches/neanderthal-startupspeed/

-- 
Lennart Regebro: Zope and Plone consulting.
http://www.colliberty.com/
+33 661 58 14 64


More information about the Grok-dev mailing list