[PATCH v5 0/7] tcache: malloc improvements

Cupertino Miranda cupertino.miranda@oracle.com
Fri Mar 21 15:12:44 GMT 2025


I was called to the attention that this patch series was missing one 
patch. Please notice within this benchmark data, that the column patch1 
refers to that missing patch.
All other contents refer to subsequent patches in v5, i.e patchN column 
in the chart refers to the patch (N-1), etc.

As the missing patch was already reviewed and accepted, it will soon be 
committed upstream.

Thanks,
Cupertino

On 21-03-2025 12:11, Cupertino Miranda wrote:
> Hi everyone,
> 
> Please find in attach both a PNG, and spreadsheet, with mimalloc-bench 
> execution comparing each individual patch in this series.
> 
> Please notice that the execution time for gs, cache-scratchN, mleak10 
> and cache-thrashN is very quick (less then 250ms) and since mimalloc- 
> bench is truncating results to 2 decimal places, the chart appears to 
> contain dubious results for those applications.
> 
> Cheers,
> Cupertino
> 
> On 21-03-2025 12:00, Cupertino Miranda wrote:
>> Hi everyone,
>>
>> New version of the patches after DJ and Wilco reviews.
>> As in previous version I decided to plot and share mimalloc-bench
>> results which I will include as attachment in reply to this thread.
>>
>> Looking forward to your comments.
>>
>> Cheers,
>> Cupertino
>>
>> Changes from v4:
>>   - Reorganized patches from most general optimizations to large chunk
>>     caching changes in tcache.
>>   - Code changes related to recent reviews from Wilco and DJ.
>> Changes from v3:
>>   - force inline of _int_free. This might make sense as a generic patch.
>>   - performance improvements
>> Changes from v2:
>>   - Redesign implementation.
>>   - Dropped strategy to remove old chunks from tcache to a better
>>     split and consolidate strategy (future patch, still work in
>>     progress).
>>   - Fixed regressions in v2.
>> Changes from v1:
>>   - Typo in the assigment to mp_.tcache_bins in do_set_cache_max
>>     function. Was setting it to MAX_TCACHE_SIZE instead of
>>     TCACHE_MAX_BINS.
>>   - Fixed testsuite regressions.
>>
>>
>> Cupertino Miranda (7):
>>    malloc: replace _int_free by _int_free_chunk in sysmalloc.
>>    malloc: optimize initialization
>>    malloc: force inline for single called functions
>>    malloc: tcache small optimizations.
>>    malloc: mangle tcache entries pointers
>>    malloc: add tcache support for large chunk caching
>>    malloc: add testing for large tcache support.
>>
>>   Rules           |  19 +++++
>>   malloc/Makefile |  15 ++++
>>   malloc/arena.c  |   2 +-
>>   malloc/malloc.c | 200 ++++++++++++++++++++++++++++++------------------
>>   4 files changed, 159 insertions(+), 77 deletions(-)
>>



More information about the Libc-alpha mailing list