Please review my fix for:

  11029 Implement Flyweight pattern and __slots__ to reduce fmri memory usage

Details in the bug report; the redux is that on my system, this saves
about 24MB of memory on install, image-update, list, etc.

  http://cr.opensolaris.org/~dp/pkg-mem/

'pkg list' gets about 15% faster on my system, as well, and the
planning phase of an image-update is about 1 second (or 5% or so)
faster.

I believe that the net result is that cache_fmri() is both much
more space efficient, and a bit faster.

If you've never heard of Flyweight, a reference is here:
http://en.wikipedia.org/wiki/Flyweight_pattern

If you've never heard of __slots__, see also:
http://docs.python.org/reference/datamodel.html#slots
They are not a panacea, fwiw.  But seem to be useful in this
case.

        -dp

-- 
Daniel Price, Solaris Kernel Engineering    http://blogs.sun.com/dp
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to