talloc vs malloc speed

Douglas Bagnall douglas.bagnall at catalyst.net.nz
Sun Apr 16 02:16:20 UTC 2023


On 15/04/23 06:11, Andreas Schneider via samba-technical wrote:
> P.S. The talloc website states it is 4% slower than malloc. This was probably
> a long long time ago ;-)

Ha. `man talloc` has almost the same sentence saying "10%".

I thought serious trouble with talloc performance has to do with the 
linked lists getting huge, making talloc_free or reparenting really slow.
And I thought that this talloc-doing-talloc cost outweighs the 
talloc-as-malloc cost, which I guess is what is being measured here?

If that's the case (I have no evidence) then optimising talloc-as-malloc 
might not really help. OTOH, because talloc makes it easier to keep track 
of millions of little allocations, we do that often, so perhaps talloced 
code is *more* sensitive to the primitive alloc cost.

Douglas



More information about the samba-technical mailing list