Re: emmalloc - a smaller option for malloc
It's pretty easy - you just need the allocator to use sbrk (instead of mmap or other things not currently possible in asm.js or wasm). On Mon, Mar 4, 2019 at 12:18 AM Soeren Balko wrote: > Just reading this now - great addition! > > On the subject of using different allocators: how easy would it be to add > other allocators (jemalloc & friends)? Or put differently: how much do more > complex features (multithreading, split memory etc.) depend on the > allocator being dlmalloc? The motivation is that dlmalloc may not be the > best allocator to handle memory fragmentation. We would hence like to play > around with some other allocators to understand the cost/benefits of using > them over dlmalloc. > > - Soeren > > On Thursday, March 8, 2018 at 11:08:48 AM UTC+10, Alon Zakai wrote: >> >> The incoming branch now has a MALLOC option which can be either dlmalloc >> (the standard allocator from before) or emmalloc, which is a new allocator >> written to be small and simple. It's about a third of the code size of >> dlmalloc, which can help on small programs that use malloc/free, where >> sometimes malloc/free is most of the binary. >> >> To try it, build with something like -s 'MALLOC="emmalloc"' . The only >> observable difference should be smaller code size (around 7K or so), but in >> some cases you may also see a performance difference - emmalloc is much >> simpler than dlmalloc,which usually doesn't matter but on benchmarks that >> stress huge amounts of tiny allocations it can be slower. For that reason >> dlmalloc is still the default. >> >> More details in >> https://github.com/kripken/emscripten/commit/78d3f20b8d515a4e1b92434519dbe7b088628fea >> >> - Alon >> >> -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to emscripten-discuss+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: emmalloc - a smaller option for malloc
Just reading this now - great addition! On the subject of using different allocators: how easy would it be to add other allocators (jemalloc & friends)? Or put differently: how much do more complex features (multithreading, split memory etc.) depend on the allocator being dlmalloc? The motivation is that dlmalloc may not be the best allocator to handle memory fragmentation. We would hence like to play around with some other allocators to understand the cost/benefits of using them over dlmalloc. - Soeren On Thursday, March 8, 2018 at 11:08:48 AM UTC+10, Alon Zakai wrote: > > The incoming branch now has a MALLOC option which can be either dlmalloc > (the standard allocator from before) or emmalloc, which is a new allocator > written to be small and simple. It's about a third of the code size of > dlmalloc, which can help on small programs that use malloc/free, where > sometimes malloc/free is most of the binary. > > To try it, build with something like -s 'MALLOC="emmalloc"' . The only > observable difference should be smaller code size (around 7K or so), but in > some cases you may also see a performance difference - emmalloc is much > simpler than dlmalloc,which usually doesn't matter but on benchmarks that > stress huge amounts of tiny allocations it can be slower. For that reason > dlmalloc is still the default. > > More details in > https://github.com/kripken/emscripten/commit/78d3f20b8d515a4e1b92434519dbe7b088628fea > > - Alon > > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
emmalloc - a smaller option for malloc
The incoming branch now has a MALLOC option which can be either dlmalloc (the standard allocator from before) or emmalloc, which is a new allocator written to be small and simple. It's about a third of the code size of dlmalloc, which can help on small programs that use malloc/free, where sometimes malloc/free is most of the binary. To try it, build with something like -s 'MALLOC="emmalloc"' . The only observable difference should be smaller code size (around 7K or so), but in some cases you may also see a performance difference - emmalloc is much simpler than dlmalloc,which usually doesn't matter but on benchmarks that stress huge amounts of tiny allocations it can be slower. For that reason dlmalloc is still the default. More details in https://github.com/kripken/emscripten/commit/78d3f20b8d515a4e1b92434519dbe7b088628fea - Alon -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.