News for hackers. Stuff that matters.
Re:Fewer mallocs in curl by dxhdr on Sunday April 23, 2017 @04:28PM (#14180295)
A structure allocated in one chunk has cache locality and will be significantly faster to access than dereferencing multiple pointers.

The allocation itself is not the bottleneck, it's the poor choice of data structure.

Re:Fewer mallocs in curl by vvanders on Sunday April 23, 2017 @04:36PM (#14180326)
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.