[PATCH v3 0/5] malloc: tcache improvements

Cupertino Miranda cupertino.miranda@oracle.com
Thu Mar 6 16:13:44 GMT 2025


Hi Wilco,

Thanks for the reply.

On 06-03-2025 15:37, Wilco Dijkstra wrote:
> Hi Cupertino,
> 
>> Thank you for those numbers.
>> This is sort of surprising to me. I need to execute this myself.
>>
>> I know the basics for executing the benchtests, like calling:
>>     make bench BENCHSET="malloc-thread"
>> But am not so familiar on how to collect the data for multiple runs and
>> further comparisons.
>> I had a quick read through the README file, but does not mention how to
>> get result comparisons.
>>
>> Maybe you can point me out to some page with documentation, or some
>> basic commands that would collect the data.
> 
> I believe there are some scripts that can take the json output and make graphs
> of it. In the past people have done this for the memcpy benchmarks, however
> it has been too long, so I have no idea how to do it today.
> 
> Most of the time I simply run the benchmarks and eyeball the numbers.
> When I want to do a more detailed comparison, I cut and paste the results into
> a spreadsheet. You can easily run benchmarks from the command-line like:
> 
> taskset -c 4 ./build/glibc/benchtests/bench-malloc-simple
> 
> (use taskset for single-threaded benchmarks for more repeatable results)
> 
> Also it's a good idea to run perf here as it shows the hot paths very clearly.
> Besides increasing the critical paths by 20+%, there is also less inlining after
> your patches (eg. _int_free is not inlined anymore).

I had this content written before reading your reply.

I have just realized that in my code basis _int_free function did not 
get inline for some reason. Do not know the reason yet.

Performance numbers on bench-malloc-thread-32 improved significantly 
once I set _int_free to __always_inline.

patch 1-4 non inlined:  "time_per_iteration": 85.8747,
patch 1-4 inlined:      "time_per_iteration": 78.6052,

patch 1-3:              "time_per_iteration": 74.175,

master:                 "time_per_iteration": 72.1569,

"This was executed on a AMD Ryzen 9 5950X. I wonder if the _int_free is 
also non inlined in your particular run with Neoverse V2." You answered 
this already. Thanks

Cheers,
Cupertino

> 
> Cheers,
> Wilco



More information about the Libc-alpha mailing list