talloc vs malloc speed

Jeremy Allison jra at samba.org
Fri Apr 14 20:25:11 UTC 2023


On Fri, Apr 14, 2023 at 08:11:46PM +0200, Andreas Schneider via samba-technical wrote:
>Hi,
>
>Florian Weimer implemented hwcaps support in glibc. This allows you to drop
>optimized libraries.
>
>The support for this is enabled in openSUSE Tumbleweed right now [1]. I've
>enabled it for libtalloc as you want to to be as fast as possible.
>
>
>Here are the results from my AMD Ryzen 9 3900X 12-Core processor.
>
>talloc x86_64_v1 (testsuite compiled with -O0)
>
>test: speed
># TALLOC VS MALLOC SPEED
>talloc:       46623469 ops/sec
>talloc_pool:  74121933 ops/sec
>malloc:       66443400 ops/sec
>success: speed
>
>=> talloc is 30% slower
>
>
>
>talloc x86_64_v3 (testsuite compiled with -O0)
>
>test: speed
># TALLOC VS MALLOC SPEED
>talloc:       47783809 ops/sec
>talloc_pool:  75068595 ops/sec
>malloc:       68073710 ops/sec
>success: speed
>
>=> talloc is 30% slower
>
>
>
>talloc x86_64_v3 (testsuite compiled with -O2)
>test: speed
># TALLOC VS MALLOC SPEED
>talloc:       50633005 ops/sec
>talloc_pool:  74245533 ops/sec
>malloc:      219259200 ops/sec
>success: speed
>
>=> talloc is 77% slower
>
>
>It looks like the optimizer is able to optimize the code a lot more if malloc
>is used.
>
>I wonder if it would be possible to give the optimizer more hints. Maybe
>Florian has some ideas :-)
>
>
>Best regards
>
>
>	Andreas
>
>
>P.S. The talloc website states it is 4% slower than malloc. This was probably
>a long long time ago ;-)

Really interesting info Andreas, thanks !

Florian, is there something you can point us at to
help us speed up talloc ?



More information about the samba-technical mailing list