mirror of
https://github.com/microsoft/mimalloc.git
synced 2024-12-26 21:04:27 +08:00
improve test-stress to run multiple iterations
This commit is contained in:
parent
dccffea662
commit
8637f113d5
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user