logoalt Hacker News

rfgplktoday at 7:03 AM3 repliesview on HN

Why? Writing a memory allocator is quite simple, and I'd argue that _everyone_ should write one from scratch for any kind of high performance application. It's also trivial to outperform general purpose allocators that have to satisfy countless constraints. I've written numerous special purpose mallocs that are a) both provably (formally) safer than the standard armada and b) significantly faster (>10x throughput).


Replies

groomlaketoday at 7:09 AM

Your experience writing memory allocators is irrelevant. The point is that jemalloc is widely used and that’s why it makes sense to be aware of it.

stackghosttoday at 7:29 AM

Writing an allocator is simple, you’re correct, but writing an allocator that doesn’t suck is not simple.

HackerThemAlltoday at 7:15 AM

I'd happily see performance, latency and stability of your allocators in massively multithreaded, long-living programs with workloads where hundreds or thousands of parallel threads continuously create and destroy short-lived small and medium objects.

Writing allocators for domain-specific access patterns is easy. Writing a general-purpose high performing, stable allocator with bounded P99 latency is hard.

Give your friend, Dunning–Kruger, some better pills to keep him from speaking through you.

show 5 replies