Neanderthal-sprint: Speeding up the Grok startup
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: