4 ms·
Yup, malloc/free isn't usually algorithmically expensive but the cache misses tend to be the brutal part. You'll spend 15 cycles doing work on 600 cycles of ca
by vvanders 10y ago
Yup, malloc/free isn't usually algorithmically expensive but the cache misses tend to be the brutal part.
You'll spend 15 cycles doing work on 600 cycles of cache fetching. Plus you've just evicted some cache for your local scope.