[PATCH] Benchtests: Improve large memcpy/memset benchmarks
Noah Goldstein
goldstein.w.n@gmail.com
Thu Mar 28 19:28:41 GMT 2024
On Wed, Mar 27, 2024 at 12:02 PM Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote:
>
> Hi Noah,
>
> > > @@ -33,7 +31,7 @@ static void
> > > do_one_test (json_ctx_t *json_ctx, impl_t *impl, char *dst, char *src,
> > > size_t len)
> > > {
> > > - size_t i, iters = 16;
> > > + size_t i, iters = (MIN_PAGE_SIZE * 8) / len;
> > maybe MAX(16, (MIN_PAGE_SIZE * )/ len). Likewise above.
>
> I'm not sure how that helps - the issue was that 16 iterations was not only
> too small for smaller sizes but also too large for large sizes. This uses 8
> iterations for the largest sizes (which takes ~7 seconds on an older machine).
I see, didn't realize 16 was too high.
Although do think we should ensure at least 1 iter.
>
> > Also, can you include the iter count in the output?
>
> The time it prints is already divided by iterations, so it's not directly usable.
>
> A better option for these benchmarks would be to print the bandwidth.
iter count allows us to better estimate the variance.
>
> Cheers,
> Wilco
More information about the Libc-alpha
mailing list