On 01/03/12 18:03, Brock Pytlik wrote:
On 01/03/12 15:23, Danek Duvall wrote:
Brock Pytlik wrote:

...
- line 1782: I wonder if this weakrefdict should simply be a member of
the PkgFmri class itself, as it seems like it would be useful in more
places than just here. The constructor could then use it directly.
You might have some issues with some places wanting their own copy of
the object, rather than a reference to an existing one, but if we had
both mutable and immutable fmri objects, that might be easier. And it
would save on parsing time regardless.
I did prototype this during development but it wasn't a win. It actually
slowed things down and caused memory bloat. My guess as to the reason is
that in a lot of situations, we aren't constructing the same FMRI over
and over (for example, reading the catalog), so we end up putting a lot
of things in the dictionary which aren't ever used again and we slow
down fmri construction because we have to fail the table lookup before
we start making the new object. I was surprised by this too, enough that
I might try it once more to confirm my results, but the results were
pretty convincing.

I'll echo Brock's comments here; I tried the same experiment some time ago when I was attempting to reduce our memory usage.

-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to