Discussion:
[Zope3-dev] New package zc.configure provides an exclude directive for excluding zcml files
Jim Fulton
2007-09-29 20:18:56 UTC
Permalink
This helps in cases where you want the configuration for a package,
but you don't want some of the configuration that it includes. This
allowed me to trim quite a bit off of the startup time, and, more
importantly, the test setup time, for a project I'm working on.

See:

http://pypi.python.org/pypi/zc.configuration

Jim

--
Jim Fulton
Zope Corporation
Lennart Regebro
2007-10-01 16:09:04 UTC
Permalink
Post by Jim Fulton
This helps in cases where you want the configuration for a package,
but you don't want some of the configuration that it includes. This
allowed me to trim quite a bit off of the startup time, and, more
importantly, the test setup time, for a project I'm working on.
Works like a charm. We tried it here at the grok sprint. Although we
were only able to speed up Grok startup with 10%. Maybe we can get to
20-30% if we work more on it, but we're not sure it's worth it.

http://regebro.wordpress.com/2007/10/01/neanderthal-sprint-speeding-up-the-grok-startup/
--
Lennart Regebro: Zope and Plone consulting.
http://www.colliberty.com/
+33 661 58 14 64
Jim Fulton
2007-10-01 16:17:18 UTC
Permalink
Post by Lennart Regebro
Post by Jim Fulton
This helps in cases where you want the configuration for a package,
but you don't want some of the configuration that it includes. This
allowed me to trim quite a bit off of the startup time, and, more
importantly, the test setup time, for a project I'm working on.
Works like a charm. We tried it here at the grok sprint. Although we
were only able to speed up Grok startup with 10%. Maybe we can get to
20-30% if we work more on it, but we're not sure it's worth it.
http://regebro.wordpress.com/2007/10/01/neanderthal-sprint-speeding-
up-the-grok-startup/
Maybe grok was already trimmed down. In my case, I basically
eliminated all ZMI support (since I didn't need it). I got about 40%,

Jim

--
Jim Fulton
Zope Corporation
Jim Fulton
2007-10-01 16:19:20 UTC
Permalink
Post by Jim Fulton
Post by Lennart Regebro
Post by Jim Fulton
This helps in cases where you want the configuration for a package,
but you don't want some of the configuration that it includes. This
allowed me to trim quite a bit off of the startup time, and, more
importantly, the test setup time, for a project I'm working on.
Works like a charm. We tried it here at the grok sprint. Although we
were only able to speed up Grok startup with 10%. Maybe we can get to
20-30% if we work more on it, but we're not sure it's worth it.
http://regebro.wordpress.com/2007/10/01/neanderthal-sprint-
speeding-up-the-grok-startup/
Maybe grok was already trimmed down. In my case, I basically
eliminated all ZMI support (since I didn't need it). I got about 40%,
Oh BTW, I ran Zope with debug logging. That way I could see what was
being included.

Jim

--
Jim Fulton
Zope Corporation
Lennart Regebro
2007-10-01 18:10:27 UTC
Permalink
Post by Jim Fulton
Post by Jim Fulton
Post by Lennart Regebro
Post by Jim Fulton
This helps in cases where you want the configuration for a package,
but you don't want some of the configuration that it includes. This
allowed me to trim quite a bit off of the startup time, and, more
importantly, the test setup time, for a project I'm working on.
Works like a charm. We tried it here at the grok sprint. Although we
were only able to speed up Grok startup with 10%. Maybe we can get to
20-30% if we work more on it, but we're not sure it's worth it.
http://regebro.wordpress.com/2007/10/01/neanderthal-sprint-
speeding-up-the-grok-startup/
Maybe grok was already trimmed down. In my case, I basically
eliminated all ZMI support (since I didn't need it). I got about 40%,
Oh BTW, I ran Zope with debug logging. That way I could see what was
being included.
Oh, useful...
--
Lennart Regebro: Zope and Plone consulting.
http://www.colliberty.com/
+33 661 58 14 64
Martijn Faassen
2007-10-02 08:30:05 UTC
Permalink
Jim Fulton wrote:

[snip]
Maybe grok was already trimmed down. In my case, I basically eliminated
all ZMI support (since I didn't need it). I got about 40%,
Grok is trimmed down in the sense that it doesn't depend on all Zope 3
packages, though due to the interesting dependency structure it still
relies on about 100 eggs. We didn't do any trimming down of ZMI support.

Would it be possible to get a list of exclude statements that you use to
eliminate ZMI support in your project? I imagine our list is far from
complete.

Regards,

Martijn
Jim Fulton
2007-10-02 13:23:26 UTC
Permalink
Post by Martijn Faassen
[snip]
Post by Jim Fulton
Maybe grok was already trimmed down. In my case, I basically
eliminated all ZMI support (since I didn't need it). I got about 40%,
Grok is trimmed down in the sense that it doesn't depend on all
Zope 3 packages, though due to the interesting dependency structure
it still relies on about 100 eggs. We didn't do any trimming down
of ZMI support.
Note that it wasn't my goal to trim the number of eggs I got,
although trimming that, or, in theory, using zipped eggs would speed
startup as well. I'm using the zope.app.zcmlfiles egg as my base.
Post by Martijn Faassen
Would it be possible to get a list of exclude statements that you
use to eliminate ZMI support in your project? I imagine our list is
far from complete.
Here is the zcml file I'm including rather than incliding
zope.app.zcmlfiles/configure.zcml:

<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:i18n="http://namespaces.zope.org/i18n"
i18n_domain="zope"
package="zope.app.zcmlfiles"
<exclude package="zope.app.catalog.browser" />
<exclude package="zope.app.container.browser" />
<exclude package="zope.app.form.browser" />
<exclude package="zope.app.generations" />
<exclude package="zope.app.intid.browser" />
<exclude package="zope.app.session" file="browser.zcml" />
<exclude package="zope.app.security.browser" />
<exclude package="zope.app.securitypolicy.browser" />

<exclude package="zope.app.authentication.browser" />


<exclude package="zope.app.authentication.browser"
file="session.zcml" />
<exclude package="zope.app.authentication"
file="ftpplugins.zcml" />
<exclude package="zope.app.authentication"
file="httpplugins.zcml" />
<exclude package="zope.app.authentication"
file="groupfolder.zcml" />
<exclude package="zope.app.authentication.browser"
file="password.zcml" />
<exclude package="zope.app.authentication"
file="principalfolder.zcml" />

<exclude package="zc.userfolder.browser" />

<!-- This was copied from zcmlfiles. Bits are commented out to
speed startup. -->

<!-- note that we need to do this early, as later startup
subscribers may break without fixups -->

<exclude package="zope.app.component.browser" />
<include package="zope.app.component" />

<include package="zope.app.generations" file="subscriber.zcml" />

<!-- Ordinary Application (non-view) configuration) -->
<!-- <include package="zope.app.interface" /> -->
<include package="zope.app.security" />
<include package="zope.component" />
<include package="zope.annotation" />
<!-- <include package="zope.app.dependable" /> -->
<include package="zope.app.content" />
<include package="zope.publisher" />

<!-- <include file="menus.zcml" /> -->

<!-- <include package="zope.copypastemove" /> -->
<!-- <include package="zope.size" /> -->
<include package="zope.location" />
<include package="zope.app.container" />

<exclude package="zope.app.publisher.xmlrpc" />
<include package="zope.app.publisher" />

<include package="zope.app.publication" file="meta.zcml" />
<include package="zope.app.publication" />


<include package="zope.traversing" />
<include package="zope.app.pagetemplate" />
<!-- <include package="zope.app.zapi" /> -->

<!-- Views -->
<!-- <include package="zope.app.http" /> -->

<!-- Translations -->
<!-- <configure package="zope.app.locales"> -->
<!-- <i18n:registerTranslations directory="." /> -->
<!-- </configure> -->

<exclude package="zope.app.i18n.xmlrpc" />
<exclude package="zope.app.i18n.browser" />
<include package="zope.app.i18n" />


<!-- Database boostrapping and maintanance -->
<include package="zope.app.appsetup" />
<include package="zope.app.zopeappgenerations" />

<!-- Services -->
<include package="zope.app.principalannotation" />

<!-- Utilities -->
<!-- <include package="zope.app.error" /> -->

<!-- Broken-object support -->
<!-- <include package="zope.app.broken" /> -->

<!-- Skins -->

<!-- <include package="zope.app.basicskin" /> -->
<include package="zope.app.rotterdam" />

<!-- Additional packages -->

<!-- <include package="zope.app.applicationcontrol" /> -->
<!-- <include package="zope.dublincore" /> -->
<include package="zope.app.wsgi" />


<!-- Content types -->
<!-- <include package="zope.app.folder" /> -->

<!-- browser Configurations -->
<include file="browser.zcml" />

</configure>

Note that this was made by just copying the configure.zcml from
zope.app.zcmlfiles and commenting out some things and adding
excludes. I basically kept commenting things or excluding things
until my tests failed. :) I could probably go a little further if I
worked a lot harder, so of course, I stopped. :) I'll also probably
have to add some things back later when I pay attention to i18n.
(This app uses extjs for it's UI and I haven't figured out how I'm
going to approach i18n for that. extjs rocks btw.)

Jim

--
Jim Fulton
Zope Corporation
Philipp von Weitershausen
2007-10-02 22:23:41 UTC
Permalink
Post by Martijn Faassen
[snip]
Post by Jim Fulton
Maybe grok was already trimmed down. In my case, I basically
eliminated all ZMI support (since I didn't need it). I got about 40%,
Grok is trimmed down in the sense that it doesn't depend on all Zope 3
packages, though due to the interesting dependency structure it still
relies on about 100 eggs. We didn't do any trimming down of ZMI support.
Note that it wasn't my goal to trim the number of eggs I got, although
trimming that, or, in theory, using zipped eggs would speed startup as
well. I'm using the zope.app.zcmlfiles egg as my base.
Post by Martijn Faassen
Would it be possible to get a list of exclude statements that you use
to eliminate ZMI support in your project? I imagine our list is far
from complete.
Here is the zcml file I'm including rather than incliding
[snip]

+1 to that approach. I think in the long term, egg-based Zope
application should want to get away from zope.app.zcmlfiles In
particular, zope.app.zcmfiles is the epitome of the ZMI app: it loads
all the browser stuff and configures the zmi_actions + zmi_views menu.

Not loading zope.app.zcmlfiles but instead selectively loading only the
stuff we need will likely reduce the ZCML processing time as well.

Death to zope.app.zcmlfiles!
--
http://worldcookery.com -- Professional Zope documentation and training
Loading...