
Memory Allocation Benchmark - monort
https://github.com/rbehrends/btree-alloc
======
rurban
I always knew malloc/free is much slower than a good GC.

In my testcase I need 4min on freeing libredwg datastructures with ordinary
sized samples. free is insanely slow, malloc is just normally slow. A GC bump
allocator is 0 cost, just like a stack alloca. But it is safe, unlike alloca
(search the rust issues for stack overflow => 700 issues) or malloc/free with
manual management.

~~~
steveklabnik
[https://github.com/rust-
lang/rust/issues?utf8=%E2%9C%93&q=is...](https://github.com/rust-
lang/rust/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+%E2%80%9Cstack+overflow%E2%80%9D)
shows 108 open, 309 closed for me, not 700. And that’s out of the almost
30,000 issues reported so far.

You can do bump allocation in non-GC’d languages too; here’s an example with
Rust: [https://hacks.mozilla.org/2019/03/fast-bump-allocated-
virtua...](https://hacks.mozilla.org/2019/03/fast-bump-allocated-virtual-doms-
with-rust-and-wasm/)

