mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 22:49:32 +03:00
improve test-stress to run multiple iterations
This commit is contained in:
parent
dccffea662
commit
8637f113d5
1 changed files with 11 additions and 7 deletions
|
@ -18,7 +18,8 @@ terms of the MIT license.
|
||||||
|
|
||||||
// argument defaults
|
// argument defaults
|
||||||
static int THREADS = 32; // more repeatable if THREADS <= #processors
|
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 THREADS = 8; // more repeatable if THREADS <= #processors
|
||||||
// static int N = 100; // scaling factor
|
// static int N = 100; // scaling factor
|
||||||
|
@ -159,14 +160,17 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
//bench_start_program();
|
//bench_start_program();
|
||||||
mi_stats_reset();
|
mi_stats_reset();
|
||||||
memset((void*)transfer, 0, TRANSFERS*sizeof(void*));
|
for (int i = 0; i < ITER; i++) {
|
||||||
run_os_threads(THREADS);
|
memset((void*)transfer, 0, TRANSFERS * sizeof(void*));
|
||||||
for (int i = 0; i < TRANSFERS; i++) {
|
run_os_threads(THREADS);
|
||||||
free_items((void*)transfer[i]);
|
for (int i = 0; i < TRANSFERS; i++) {
|
||||||
|
free_items((void*)transfer[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
mi_collect(false);
|
mi_collect(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mi_stats_print(NULL);
|
mi_stats_print(NULL);
|
||||||
//bench_end_program();
|
//bench_end_program();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue