[PATCH 0/6] malloc: TCACHE improvement for free and calloc

Noah Goldstein goldstein.w.n@gmail.com
Thu Aug 22 19:17:24 GMT 2024


On Wed, Aug 21, 2024 at 8:02 PM Wangyang Guo <wangyang.guo@intel.com> wrote:
>
> This series aims to improve TCACHE performance in memory allocator:
> simplify TCACHE code path in free() and add TCACHE support for calloc().
>
> Wangyang Guo (6):
>   malloc: Split _int_free() into 3 sub functions
>   malloc: Avoid func call for tcache quick path in free()
>   malloc: Arena is not needed for tcache path in free()
>   benchtests: Add calloc function test to bench-malloc-thread
>   malloc: Add tcache path for calloc
>   malloc: Fix tst-safe-linking failure after enable tcache
>
>  benchtests/bench-malloc-thread.c | 114 +++++++++-----
>  malloc/malloc.c                  | 249 ++++++++++++++++++++-----------
>  malloc/tst-safe-linking.c        |  81 ++++++++--
>  3 files changed, 302 insertions(+), 142 deletions(-)
>
> --
> 2.43.0
>


NB: Bencharked this patch:

malloc results: malloc-new/malloc-old
nthread,size-range ,rss      ,time
1      ,4-32768    ,1.000000 ,0.894578
8      ,4-32768    ,1.006898 ,0.885221
16     ,4-32768    ,1.000108 ,0.903998
32     ,4-32768    ,1.011235 ,0.906448

calloc results: malloc-new/malloc-old
nthread,size-range ,rss      ,time
1      ,4-32768    ,0.987175 ,0.676043
8      ,4-32768    ,0.689707 ,0.489121
16     ,4-32768    ,0.550806 ,0.481561
32     ,4-32768    ,0.607041 ,0.477121

Pretty good, esp for calloc


More information about the Libc-alpha mailing list