launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #04247
Re: performance tuesday - a few notes
On Thu, Aug 12, 2010 at 09:19:35AM -0300, Guilherme Salgado wrote:
> We used to avoid cachedproperties on model classes as debugging things
> when you have a (sometimes unexpected) caching at that layer is not fun,
> but we seem to have lots of them now.
>
> I remember that Bjorn used to advocate strongly for us not using them.
FWIW, the reason I usually advocate against cachedproperty on model
classes is basically what Salgado said. Especially since usually you can
solve the problem in some other way, which makes it more clear that
caching (that isn't being automatically invalidated when needed) is
used.
What I don't like about cachedproperty is that it easily becomes a tool
that simply replaces @property. People just just it, just in case it's
needed, without any thought about what the implications are.
That said, I'm not against that kind of caching on the model object.
Most of our request are read transactions, and for such transactions
it's safe to use. It might be intresting experimenting with
automatically caching properties in read transactions.
--
Björn Tillenius | https://launchpad.net/~bjornt
Follow ups
References