lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 23 June 2018 at 21:56, Philipp Janda <> wrote:
>> 8. Faster memory allocation by integrating Doug Lea's malloc library.
> Are you sure that dlmalloc is actually faster than the native libc malloc?
> It's a great piece of software for sure but a few decades old by now. libc
> implementors have had ample time to catch up (or at least integrate dlmalloc
> into their own code -- it's public domain software after all).

In my tests yet. Gains are more on Windows than on Linux.

DL malloc has a arena option / and locking / thread local access can
be disabled as Lua is single threaded. You can't switch off those
features in a generic malloc.

BTW note that LuaJIT also uses the same arena feature - with small
customizations for dealing with memory start address etc. But
essentially it is DL malloc arena code.