Discussion:
[Erp5-dev] programmable acquisition and performance
bartek
2008-02-06 16:12:10 UTC
Permalink
Hello

I find programmable acquisition very convenient, and I started using it
rather extensively for a project I'm working on (e.g. my "group" base
category has 5 "acquisition_base_categories"). I noticed a considerable
decrease in performance, but I'm not sure whether this is the reason -
is programmable acquisition so heavy? And if so, then why, and can it be
optimized somehow?

Bartek
--
"feelings affect productivity. (...) unhappy people write worse
software, and less of it."
Karl Fogel, "Producing Open Source Software"
Pelletier Vincent
2008-02-07 08:05:23 UTC
Permalink
Post by bartek
Hello
Hi Bartek
Post by bartek
I noticed a considerable
decrease in performance, but I'm not sure whether this is the reason -
is programmable acquisition so heavy? And if so, then why, and can it be
optimized somehow?
As noted in the [1] wiki page ("Is there any side effect by the patch?"
section), _aq_dynamic is called every time __getattr__ returns None.
So every time a skin lookup is done (form, page template, script, etc) the
custom acquisition method will be fired, for example.
I think the first optimisation to do is to have a quick check at _aq_dynamic
begining to detect cases where it will return None, and do so immediately.

[1] http://www.erp5.org/WhyAqDynamicIsRequired
--
Vincent Pelletier
Jean-Paul Smets
2008-02-07 09:02:02 UTC
Permalink
Hi,

I think bartek is discussing another issue: the acquisition of values
through categories.

- convenient: yes
- heavy: potentially, yes
- optimisable: not sure

This is why we use it when it is the clean way to do and we try not to
use it when it is not necessary.

There are already optimisations (with read only transaction caches).

I am not sure if it is possible to optimise it so much because part of
the performance cost is related to the access time to many ZODB objects
rather than a few. The first kind of optimisation to do is to try to
call the accessor once in a transaction rather than 10 times.

Regards,

JPS.
Post by Pelletier Vincent
Post by bartek
Hello
Hi Bartek
Post by bartek
I noticed a considerable
decrease in performance, but I'm not sure whether this is the reason -
is programmable acquisition so heavy? And if so, then why, and can it be
optimized somehow?
As noted in the [1] wiki page ("Is there any side effect by the patch?"
section), _aq_dynamic is called every time __getattr__ returns None.
So every time a skin lookup is done (form, page template, script, etc) the
custom acquisition method will be fired, for example.
I think the first optimisation to do is to have a quick check at _aq_dynamic
begining to detect cases where it will return None, and do so immediately.
[1] http://www.erp5.org/WhyAqDynamicIsRequired
--
Jean-Paul Smets-Solanes, Nexedi CEO - Tel. +33(0)6 62 05 76 14
ERP5 Enterprise: Free / Open Source ERP for Critical Applications
http://www.erp5.com
ERP5 Express: Hosted Open Source ERP for small companies
http://www.myerp5.com
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
Loading...