On Fri, Jul 13, 2018 at 11:14:24AM -0400, Randell Jesup wrote:
Hash tables are a big issue.  There are a lot of 64K/128K/256K
allocations at the moment for hashtables.  When we started looking at
this in bug 1436250, we had a 256K, ~4 128K, and a whole bunch of 64K
hashtable allocs (on linux).  Some may be smaller or gone now, but it's
still big.

I wonder if it's worth the perf hit to realloc to exact size hash tables
that are build-once - probably.  hashtable->Finalize()?  (I wonder if
that would let us make any other memory/speed optimizations if we know
the table is now static.)

I think, as much as possible, we really want static or mostly-static hash tables to be shared between processes. I've already been working on this in a few areas, e.g., bug 1470365 for string bundles, which are completely static, and bug 1471025 for preferences, which are mostly static.

And those patches add helpers which should make it pretty easy to do the same for more things in the future, so that should probably be our go-to strategy for reducing per-process overhead, when possible.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to