[Ur] missunderstanding - or serious memory handling issue?

Adam Chlipala adamc at impredicative.com
Wed Dec 8 09:49:45 EST 2010


Marc Weber wrote:
> The next I wasn't sure about was speed: Is it worth trying to avoid some
> mallocs or not.
>    

That's the main motivation for the special handling of context-local 
heaps.  I want this code to scale to many-core execution, and malloc() 
will inevitably incur some thread synchronization overhead, while 
parceling out chunks of a persistent thread-local heap is almost free.

To me, this implies that if you do anything that is probably going to 
trigger some thread synchronization operations anyway (say, any IO, or 
calling a beast like the Ruby interpreter), then the performance 
argument stops being compelling.  If it's easy to register a "free" 
handler, then the programmer productivity argument also becomes void.



More information about the Ur mailing list