[rucksack-devel] Re: Fwd: State of the nation and heap patch

Arthur Lemmens alemmens at xs4all.nl
Tue Jan 22 17:29:53 UTC 2008


Sean Ross wrote:

> The good news is that I believe I have found the cause of the index corruption.
> It appears to be the way persistent objects are referenced in the
> indexes. Seeing that they are not stored directly in the class and
> slot indexes, but rather have their object-id saved instead, they are
> never added to the heap roots during the scanning stage of gc, never
> marked as :live-object's  and end up being deallocated prematurely.

Yes, that sounds like a good analysis.

> I do have a fix (albeit simple) for this which merely stores the the
> persistent-object as the index-value instead of the object-id.
> Unfortunately this does mean that the :id-only argument to
> rucksack-map-class and rucksack-map-index would have to be removed.

That was just an (obviously premature) optimization hack anyway.  I'll
be happy to get rid of it in return for something that actually works.

> don't know if that fits in with where you see rucksack going in the
> future but if it is please let me know and I'll supply the patch.

I'm definitely interested in the patch.  Thanks in advance.

> have to admit that after giving it some thought i could not think of a
> situation where :id-only would be particularly useful

My idea was that there might be situations where you want to do
something with sets of objects without actually having to load them.
But I'm not so sure that was a good idea, and I don't think it's used
anywhere in the Rucksack code at the moment.

> Ironically storing the object itself rather than the object-id has
> also given a rather dramatic speed increase (a 50%+ reduction in time
> taken) when using rucksack-map-slot

Right, so my hack is like most 'optimizations': not only is it wrong,
but it also makes things slower...

Arthur





More information about the rucksack-devel mailing list