[Zope-dev] implementing zope.component 4.0

Adam GROSZER agroszer at gmail.com
Sun Nov 29 15:47:40 EST 2009


Hello Hanno,

Seems that that was an adapter heavy app.

Was before the cut:

 >>> len(getGlobalSiteManager()._utility_registrations)
 980
 >>> len(getGlobalSiteManager()._adapter_registrations)
 1432
 >>> len(getGlobalSiteManager()._handler_registrations)
 63
 >>> len(getGlobalSiteManager()._subscription_registrations)
 50

After the cut:
 
 >>> len(getGlobalSiteManager()._utility_registrations)
 739
 >>> len(getGlobalSiteManager()._adapter_registrations)
 933
 >>> len(getGlobalSiteManager()._handler_registrations)
 37
 >>> len(getGlobalSiteManager()._subscription_registrations)
 33

So around 1/3 of the registrations was gone and that made a difference
(well, with z3c.form generated forms).

Would be interesting to profile how many adapter lookups are done by a
simple z3c.form to render...


 
Saturday, November 28, 2009, 2:32:50 PM, you wrote:

HS> On Sat, Nov 28, 2009 at 12:14 PM, Martijn Faassen
HS> <faassen at startifact.com> wrote:
>> Adam GROSZER wrote:
>>> I had a feeling that adapter lookup can be alone slowish with lots of
>>> registrations.
>>> We had a large project that was cut in half and the z3c.form UI, which
>>> is rather heavily adaptation based got a boost after that.

HS> What is a "large project" in your case? Just as an example here's the
HS> "size" of the global registry in a typical Plone project:

 >>>> getGlobalSiteManager()
HS>  <BaseGlobalComponents base>
 >>>> len(getGlobalSiteManager()._utility_registrations)
HS>  1091
 >>>> len(getGlobalSiteManager()._adapter_registrations)
HS>  1283
 >>>> len(getGlobalSiteManager()._handler_registrations)
HS>  139
 >>>> len(getGlobalSiteManager()._subscription_registrations)
HS>  3

>> Interesting. It'd be interesting to do some experiments with this. Could
>> you perhaps look into writing some kind of stress-test script?

HS> I haven't done any real performance measurements but the various
HS> zope.interface/component API's are among the top of every profile run
HS> I do in Plone.

HS> To me it looks like checking if an interface is provided by a context
HS> is non-trivial and the main bottleneck in our case. The classes
HS> underlying our typical contexts are pretty fat classes with a long
HS> inheritance chain contributing dozens of interfaces.

HS> The actual registry lookups seem to be rather fast, they should be
HS> essentially dict lookups, which perform well with a dict size of just
HS> about 1000.

HS> On the other hand I noticed that z3c.form and it's use of the ZCA is
HS> indeed much slower than stitching forms together via ZPT macros as
HS> done for example by Archetypes.

HS> Hanno
HS> _______________________________________________
HS> Zope-Dev maillist  -  Zope-Dev at zope.org
HS> https://mail.zope.org/mailman/listinfo/zope-dev
HS> **  No cross posts or HTML encoding!  **
HS> (Related lists - 
HS>  https://mail.zope.org/mailman/listinfo/zope-announce
HS>  https://mail.zope.org/mailman/listinfo/zope )


-- 
Best regards,
 Adam GROSZER                            mailto:agroszer at gmail.com
--
Quote of the day:
The only way to amuse some people is to slip and fall on an icy pavement.



More information about the Zope-Dev mailing list