On Wed, 2006-12-20 at 10:13 +0100, Stephan Bergmann wrote:
> Caolan McNamara wrote:
> > On Tue, 2006-12-19 at 16:36 +0000, Michael Meeks wrote:
> >> Hi there,
> >>
> >>    So - in my ongoing campaign to shrink memory usage, it seems that the
> >> cppuhelper classes use the (uber-stupid) stl::hash_map code that insists
> >> on allocating a staggering amount of memory for an empty hash (as
> >> previously discussed).
> > 
> > Maybe it is worth jamming a TR1 alike <unordered_map> implementation
> > hash_map replacement with a more sensible initial allocation system into
> > o3l and convert to using that in one fell swoop ? 
> 
> What is o3l?  (Anyway, yes, replacing STLport's hash_map with something 
> more standard and future oriented looks like a good move to me---modulo 
> any potential compatibility issues, of course.)

Sorry, typo. I meant into the o3tl module which I assume expands to
"OpenOffice.org Template Library", which looked like a natural place for
something like this. 

But digging around a bit further it won't make much of a difference
really unless we implement our own better one because I see that
STLport5.1.0 has an an unordered_map implementation now, upgrading to
use that would make unordered_map available. But unordered_map still
backs onto the same hashtable that the STLport uses for hash_map and
both hash_map and unordered_map share the same default initial sizes of
100, and any explicit size setting for the hash_map will be downwardly
limited to the smallest prime allowed in hashtable.c

The good news though is that hdu's patch for reducing the smallest
allowed explicit initial size is now in stlport5

i.e. 

#  define __PRIME_LIST_BODY { \
  7ul,          23ul, \

instead of 

# define __PRIME_LIST_BODY { \
  53ul,         97ul,         193ul,       389ul,       769ul,      \

so maybe the least effort route after al is to go with hdu's two patches
to our stlport for the above upstreamed change and for the empty
hashtable optimization.

C.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to