This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] benchtests: New strlen-struct benchmark
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: Siddhesh Poyarekar <siddhesh at sourceware dot org>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Cc: "carlos at redhat dot com" <carlos at redhat dot com>, nd <nd at arm dot com>
- Date: Wed, 8 Aug 2018 15:43:38 +0000
- Subject: Re: [PATCH] benchtests: New strlen-struct benchmark
- References: <20180807195022.29149-1-siddhesh@sourceware.org>
Hi Siddhesh,
So my first question is, what are you trying to benchmark here?
The strings are all identically sized so it won't stress strlen. The
layout of the structs and strings is such that it ends up as one linear
sweep of memory (which any prefetcher should be able to spot).
Would better results on this test mean real code gets faster too?
If you want to benchmark strlen in a more realistic way then it would
make sense to do something like the random memcpy (create an
array of strings based on a measured distribution and ensure the
strings are not laid out linearly in memory).
If you have a specific workload you want to mimic then it may be
better to keep it closer to the original code. Traversing a linked list of
10000 entries with 32KB strings seems quite unusual...
Cheers,
Wilco