From: Andreas Schneider Date: Wed, 29 Mar 2023 09:04:38 +0000 (+0200) Subject: doc: Update doc about talloc vs malloc speed X-Git-Tag: tdb-1.4.13~1041 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=03e880931d0a6171826f5ffc33e7b4d86eea54a6;p=thirdparty%2Fsamba.git doc: Update doc about talloc vs malloc speed Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Sat Sep 28 01:20:01 UTC 2024 on atb-devel-224 --- diff --git a/lib/talloc/doc/mainpage.dox b/lib/talloc/doc/mainpage.dox index ece6ccb8f0c..d881e503a43 100644 --- a/lib/talloc/doc/mainpage.dox +++ b/lib/talloc/doc/mainpage.dox @@ -69,11 +69,11 @@ * @section talloc_performance Performance * * All the additional features of talloc() over malloc() do come at a price. We - * have a simple performance test in Samba4 that measures talloc() versus - * malloc() performance, and it seems that talloc() is about 4% slower than - * malloc() on my x86 Debian Linux box. For Samba, the great reduction in code - * complexity that we get by using talloc makes this worthwhile, especially as - * the total overhead of talloc/malloc in Samba is already quite small. + * have a performance test in Samba that measures talloc() versus malloc() + * performance, and it seems that talloc() is about 50% slower than malloc() + * (AMD Ryzen 9 3900X). For Samba, the great reduction in code complexity that + * we get by using talloc makes this worthwhile, especially as the total + * overhead of talloc/malloc in Samba is already quite small. * * @section talloc_named Named blocks * diff --git a/lib/talloc/man/talloc.3.xml b/lib/talloc/man/talloc.3.xml index c51061fce1f..e26b16dbecf 100644 --- a/lib/talloc/man/talloc.3.xml +++ b/lib/talloc/man/talloc.3.xml @@ -767,12 +767,12 @@ if (ptr) memcpy(ptr, p, strlen(p)+1); PERFORMANCE All the additional features of talloc(3) over malloc(3) do come at a - price. We have a simple performance test in Samba4 that measures - talloc() versus malloc() performance, and it seems that talloc() is - about 10% slower than malloc() on my x86 Debian Linux box. For - Samba, the great reduction in code complexity that we get by using - talloc makes this worthwhile, especially as the total overhead of - talloc/malloc in Samba is already quite small. + price. We have a performance test in Samba that measures talloc() versus + malloc() performance, and it seems that talloc() is + about 50% slower than malloc() (AMD Ryzen 9 3900X). For Samba, the great + reduction in code complexity that we get by using talloc makes this + worthwhile, especially as the total overhead of talloc/malloc in Samba + is already quite small. SEE ALSO diff --git a/lib/talloc/talloc_guide.txt b/lib/talloc/talloc_guide.txt index dedda6c0678..d6e3646a1bd 100644 --- a/lib/talloc/talloc_guide.txt +++ b/lib/talloc/talloc_guide.txt @@ -43,12 +43,11 @@ testsuite.c to clarify how some particular situation is handled. Performance ----------- -All the additional features of talloc() over malloc() do come at a -price. We have a simple performance test in Samba4 that measures -talloc() versus malloc() performance, and it seems that talloc() is -about 4% slower than malloc() on my x86 Debian Linux box. For Samba, -the great reduction in code complexity that we get by using talloc -makes this worthwhile, especially as the total overhead of +All the additional features of talloc() over malloc() do come at a price. We +have a performance test in Samba4 that measures talloc() versus malloc() +performance, and it seems that talloc() is about 50% slower than malloc() (AMD +Ryzen 9 3900X). For Samba, the great reduction in code complexity that we get by +using talloc makes this worthwhile, especially as the total overhead of talloc/malloc in Samba is already quite small.