4 ms·
Note that one of these steps, the one where you replace jemalloc with the system allocator, is quite likely to become the default behavior sometime after the gl
by kibwen 9y ago
Note that one of these steps, the one where you replace jemalloc with the system allocator, is quite likely to become the default behavior sometime after the global allocator API stabilizes (which should happen this year). It's a bit of a shame because jemalloc really is faster than the system allocator, often by a significant margin, but in practice jemalloc is a very large burden to package in-tree, plus it largely contributes to binary bloat as seen here, and also tools like valgrind don't play nicely with anything other than the system allocator. Of course, we won't make the switch until we have an easy way to get jemalloc back via crates.io, for our users who really want jemalloc's performance benefits.
- GrayShade 9y agoI think GLIBC 2.26 added a per-thread cache, so it might no longer be that slow when compared to jemalloc.
- kibwen 9y agoI'm under the impression that what also makes jemalloc fast is that it has a richer API than glibc malloc (in a way that isn't drop-in compatible, so libc-compatible malloc can't ever provide it), thereby giving it more info that it can use for optimization (but also stymying tools like valgrind).
- GrayShade 9y agoThat's sized deallocation, right? Unfortunately, GLIBC doesn't seem to provide it.