• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: jemalloc to replace default allocator
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: jemalloc to replace default allocator


  • Subject: Re: jemalloc to replace default allocator
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 7 May 2010 13:30:59 -0700


On May 7, 2010, at 2:59 AM, Alastair Houghton wrote:

Why do that? My understanding is that jemalloc's primary advantage is massive scalability for heavily threaded code. Firefox isn't *that* heavily threaded, right?
In any event, the system allocator on Mac OS X has always been pretty good, and it looks like the Snow Leopard version is already designed with per-processor "magazines" for small allocations.

Safari has long used a custom allocator (tcmalloc) for performance reasons. It makes a significant difference on standard browser benchmarks, I'm told, although I heard that before 10.6 came out. Chrome uses tcmalloc on Windows and Linux, and probably will eventually on Mac too.


Neither of these goes as far as overriding malloc itself. Instead they define their own allocator functions and then use those instead of calling malloc directly. (Simply overriding ::operator new() gets you a lot of the way there, for a C++ app.)

In the case of JavaScript (or other GC'd languages) you get the biggest speed boost from not using a normal allocator at all. The usage patterns of a GC system are very different because freeing blocks happens rarely and in huge batches. A typical GC allocator will allocate space by simply bumping a global pointer, and trigger a minor collection when the pointer hits the end of the space. This is one of the things that makes V8 fast.

—Jens _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: jemalloc to replace default allocator
      • From: Jean-Daniel Dupas <email@hidden>
    • Re: jemalloc to replace default allocator
      • From: Alastair Houghton <email@hidden>
References: 
 >jemalloc to replace default allocator (From: Joel Reymont <email@hidden>)
 >Re: jemalloc to replace default allocator (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Absolute Addressing and asm
  • Next by Date: Re: jemalloc to replace default allocator
  • Previous by thread: Re: jemalloc to replace default allocator
  • Next by thread: Re: jemalloc to replace default allocator
  • Index(es):
    • Date
    • Thread