You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Murphy, James" <Ja...@excelergy.com> on 2001/09/25 22:57:37 UTC

DOMString allocation operators

DOMStrings new and delete operators ruin performance on SMP systems due to
the global lock on both new and delete.  This lock is acquired when actually
performing the block allocation and when doling out the block elements.
This makes the DOM unusable for us since our environment is multithreaded,
and multi CPU.

I set of to "fix" the allocator by creating several memory pools managed
much the same as the single memory pool implemented currently.  Depending on
thread ID you are pointed to a pool for allocation.  This distributed the
contention around enough to give us better performance.  We eventually hit a
wall with general memory allocation.  We decided to link with smartheap and
found we were scaling much better.  

I decided a radical idea...remove the local new and delete on DOMString and
let smartheap handle all allocations.  This ended up working _almost_ as
good as before, and it didn't need my new allocator code.  

I realize that everyone is not going to link with a 3rd party allocator like
we are but would like a way to get rid of DOMString's allocation functions.
Any thoughts on this?

Jim

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org