esme-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Hirsch <>
Subject Re: Memory allocation and lazy vals
Date Sat, 28 Nov 2009 15:39:36 GMT
Vassil just did a commit, so it could already be fixed.

I'd try it out. :->


On Sat, Nov 28, 2009 at 4:37 PM, Markus Kohler <> wrote:
> W00T!
> ESME will fly as soon as this is fixed!
> Markus
> On Nov 28, 2009 2:36 PM, "Vassil Dichev" <> wrote:
> I found a weird thing today. Lazy vals don't act lazy under certain
> conditions.
> For those who are not familiar with lazy values, they are values which:
> - are calculated on demand
> - are memoized so that the next invocation won't compute the same code again
> You can find a nice article about behavior of lazy vals here:
> In ESME's case, lazy values are used to format a message into XML and
> XHTML only once per instance (does that ring any bells?). What happens
> in Message, though, is that digestedXHTML, toXml and originalXml,
> which are all lazy, are executed again and again on each consecutive
> call! I'm not sure why that is, but if I change the access of object
> text to returning a hardcoded value, it works as expected, and gets
> evaluated only once.
> I'm currently trying to find the reason for this phenomenon and find
> workarounds. This detail undermines our implementation of caching
> messages, but at least now we know what causes the strange behavior
> observed by Markus.

View raw message