[PATCH] malloc: Optimize small memory zeroing for calloc
Noah Goldstein
goldstein.w.n@gmail.com
Wed Nov 27 15:50:01 GMT 2024
On Wed, Nov 27, 2024 at 1:46 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> For memory size up to 9 * INTERNAL_SIZE_T bytes, calloc has special codes
> to clear the memory. Add calloc-clear-memory.h to allow architecture
> specific optimization. On x86-64, it uses up to 1 branch, instead of 3,
> and up to 5 stores, instead of 9, by using overlapping vector stores:
>
> Test Platform: Xeon-8380
> Bench Function: calloc
> Ratio: New / Original time_per_iteration (Lower is Better)
>
> Threads# | Ratio
> -----------|------
> 1 thread | 0.953
> 4 threads | 0.952
>
> OK for master?
>
> Thanks.
>
> --
> H.J.
I have some comments on the patch, can you post it inlined in the email
instead of as an attachment for the sake of review?
More information about the Libc-alpha
mailing list