Skip to content

Memory allocator on OS/X

3 messages · Simon Urbanek, Jason Foster

#
A quick scan though the mailing list archives didn't reveal any  
reference to this article, so here goes:

   http://ridiculousfish.com/blog/archives/2006/05/16/36/

In response to a criticism of OS X, a diligent blogger examined a  
claim that it was an inherently slow operating system.  The  
application in question was R, and the results were...

"Linux uses ptmalloc, which is a thread-safe implemenation based on  
Doug Lea?s allocator (Sekhon?s test is single threaded,  
incidentally). R also uses the Lea allocator on Windows instead of  
the default Windows malloc. But on Mac OS X, it uses the default  
allocator."

... and ...

"If you use the same allocator on Mac OS X that R uses on Windows,  
the performance differences all but disappear."

Would it make sense for the build process that generates R binaries  
for OS X to use the Lea allocator?

Jason Foster
#
Jason,
On May 19, 2006, at 6:37 PM, Jason Foster wrote:

            
Somehow you managed to miss it, we had a discussion about this quite  
recently:
http://www.mail-archive.com/r-sig-mac%40stat.math.ethz.ch/msg00770.html

Also based on private e-mail exchange with all involved parties the  
preliminary answer is no. The mentioned speed-up occurred only after  
patching the involved code, R was actually not even modified. It is  
still unclear whether a modification of R is safe and whether any  
speed up is to be expected. I hope to have a quiet minute during the  
weekend so I can test the various hypotheses... (There are two  
separate issues to be addressed: system malloc/free and BLAS  
performance).

Cheers,
Simon