1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

benchtests: Reallocate buffers for memset

Keeping the same buffers along with copying the same size of data into
the same location means that the first routine is typically the
slowest since it has to bear the cost of fetching data into to cache.
Reallocating buffers stabilizes numbers by a bit.

	* benchtests/bench-string.h (realloc_bufs): New function.
	(test_init): Call it.
	* benchtests/bench-memset-large.c (do_test): Likewise.
	* benchtests/bench-memset.c (do_test): Likewise.
This commit is contained in:
Siddhesh Poyarekar
2017-09-14 22:39:49 +05:30
parent 29c933fb35
commit 503c92c37a
4 changed files with 52 additions and 13 deletions

View File

@ -90,7 +90,10 @@ do_test (json_ctx_t *json_ctx, size_t align, int c, size_t len)
json_array_begin (json_ctx, "timings");
FOR_EACH_IMPL (impl, 0)
do_one_test (json_ctx, impl, (CHAR *) (buf1) + align, c, len);
{
do_one_test (json_ctx, impl, (CHAR *) (buf1) + align, c, len);
realloc_bufs ();
}
json_array_end (json_ctx);
json_element_object_end (json_ctx);