|
|
|
|
|
by ctxcode
719 days ago
|
|
Interesting article. 16-24 bytes per allocation is pretty big and it sounds like it would a bit too much overhead, an actual demo would be nice. My approach with Valk is to allocate per type size and in incremental sized blocks. These blocks work alot like tiny bump allocators and can be reset with 1 line of code without losing the objects in it that are still used. If the overal memory usage increased a certain percent, we trace the stack, clean up the blocks from long existing objects and free blocks that are completely empty. My benchmark performes 2x faster than rust, and 4x golang. We use 8 bytes per allocation. |
|
So 8 bytes per allocation sounds about right.
How do you deal with variable size types like arrays?