[PATCH v3 0/5] malloc: tcache improvements
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Thu Mar 6 17:01:20 GMT 2025
Hi Cupertino,
> 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.
It's because _int_free() and _int_free_check() must be inlined for performance
but aren't correctly marked as __always_inline. I think that is a bug due to the
recent cleanups.
> Performance numbers on bench-malloc-thread-32 improved significantly
> once I set _int_free to __always_inline.
Indeed, bench-malloc-simple looks far better with that (2.4% average slowdown),
though bench-malloc-thread still shows a fairly large 22-23% loss. Perf results
suggest the slowdown is mainly due to malloc() since its sample count increases
by almost 50%! I don't see a function that isn't inlined, but it's likely something
obvious here too.
Cheers,
Wilco
More information about the Libc-alpha
mailing list