improve test-stress to run multiple iterations

This commit is contained in:
Daan Leijen 2019-11-15 14:09:17 -08:00
parent dccffea662
commit 8637f113d5

View File

@ -18,7 +18,8 @@ terms of the MIT license.
// argument defaults
static int THREADS = 32; // more repeatable if THREADS <= #processors
static int N = 20; // scaling factor
static int N = 20; // scaling factor
static int ITER = 10; // N full iterations re-creating all threads
// static int THREADS = 8; // more repeatable if THREADS <= #processors
// static int N = 100; // scaling factor
@ -159,14 +160,17 @@ int main(int argc, char** argv) {
//bench_start_program();
mi_stats_reset();
memset((void*)transfer, 0, TRANSFERS*sizeof(void*));
run_os_threads(THREADS);
for (int i = 0; i < TRANSFERS; i++) {
free_items((void*)transfer[i]);
for (int i = 0; i < ITER; i++) {
memset((void*)transfer, 0, TRANSFERS * sizeof(void*));
run_os_threads(THREADS);
for (int i = 0; i < TRANSFERS; i++) {
free_items((void*)transfer[i]);
}
}
#ifndef NDEBUG
#ifndef NDEBUG
mi_collect(false);
#endif
#endif
mi_stats_print(NULL);
//bench_end_program();
return 0;