r2733: added a note on performance
[samba.git] / talloc_guide.txt
index ae75f73d8eccfebc50aeee0f8f312b63157529a6..24438ba722ce24cdecee3f1c6f88c214d5638c7f 100644 (file)
@@ -39,6 +39,18 @@ source/torture/local/talloc.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 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.
+
+
 talloc API
 ----------