benchtests: Reallocate buffers for memset
commit503c92c37a95f769762e65aff9383b302178c2bc
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Thu, 14 Sep 2017 17:09:49 +0000 (14 22:39 +0530)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Thu, 14 Sep 2017 17:24:24 +0000 (14 22:54 +0530)
tree6374607403822c719c9e0719e549478b378557c0
parent29c933fb35b7bf872f57dc6977c879832983ab6c
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.
ChangeLog
benchtests/bench-memset-large.c
benchtests/bench-memset.c
benchtests/bench-string.h