Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

this zeroes memory on every allocation and deallocation. huge perf hit


Zeroing on allocation is almost free. You can invent microbenchmarks where it hurts, but for most workloads it doesn't matter. You can also invent micro cases where it is beneficial, because the cache is hot after the zeroing.

The always kernel zeros all userspace allocations, and always has.

In a former life, I actually tested this on an x86 webserver workload: the overhead of zeroing on allocation on CPUs that were Ivy Bridge or newer was so small it was literally impossible to measure in high-level web metrics. Sandy Bridge took a 1-2% hit in request throughput as I recall.

Zeroing on free is a different story though, that trashes the cache.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: