3 ms·
The Rust Performance Book
- hayley-patton 4y agoSection 8 "Heap allocations": > Heap allocations are moderately expensive. The exact details depend on which allocator is in use, but each allocation (and deallocation) typically involves acquiring a global lock, doing some non-trivial data structure manipulation, and possibly executing a system call. One sure hopes it doesn't take a global lock for each allocation; I don't think jemalloc does.