3 ms·
Aside from what the other reply said: heap allocations do incur management overhead and are prone to things like fragmentation. Stack allocation is literally a
by gcp 10y ago
Aside from what the other reply said: heap allocations do incur management overhead and are prone to things like fragmentation. Stack allocation is literally a single add/sub micro-op.
- Rusky 10y agoFurther, all stack allocations for a frame can be coalesced into a single add/sub.