[PATCH v4] benchtest: malloc tcache hotpath benchtest.
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Mon May 12 17:48:09 GMT 2025
Hi Cupertino,
>> Then you would be measuring the overhead of a memory barrier...
> I presume overhead of memory barrier is the wait for all memory to be
> committed. In such a benchmark which all writes are for the malloc
> infrastructure that would be Ok. But I think we do not need to add them
> as the dependencies are there.
What you end up with is measuring how aggressive a CPU is in optimizing
memory barriers - a simple CPU may indeed stall until all memory accesses
are completed, but an advanced one may continue execution as if it didn't
exist. So it highly depends on microarchitecture, and it would end up being
a worse benchmark since real code don't use barriers after malloc/free...
>> Well you could measure both in principle.
> Ok, I will change the code to keep both scenarios, and record
> performance for both. Just to make sure we are in sync. Keeping an array
> with 5 allocations and looping through those allocating a new and
> freeing the oldest is enough to hide the dependencies ?
Yes that sounds fine.
Cheers,
Wilco
More information about the Libc-alpha
mailing list