@@ -35,6 +35,10 @@ static void multithreaded(benchmark::internal::Benchmark *benchmark) {
35
35
benchmark->Threads (1 );
36
36
}
37
37
38
+ static void singlethreaded (benchmark::internal::Benchmark *benchmark) {
39
+ benchmark->Threads (1 );
40
+ }
41
+
38
42
static void
39
43
default_multiple_alloc_fix_size (benchmark::internal::Benchmark *benchmark) {
40
44
benchmark->Args ({10000 , 1 , 4096 });
@@ -68,15 +72,17 @@ UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark, proxy_pool,
68
72
UMF_BENCHMARK_REGISTER_F (multiple_malloc_free_benchmark, proxy_pool)
69
73
->Apply(&default_multiple_alloc_fix_size)
70
74
// reduce iterations, as this benchmark is slower than others
71
- ->Iterations(50000 );
75
+ ->Iterations(50000 )
76
+ ->Apply(&singlethreaded);
72
77
73
78
UMF_BENCHMARK_TEMPLATE_DEFINE (multiple_malloc_free_benchmark, os_provider,
74
79
fixed_alloc_size,
75
80
provider_allocator<os_provider>);
76
81
UMF_BENCHMARK_REGISTER_F (multiple_malloc_free_benchmark, os_provider)
77
82
->Apply(&default_multiple_alloc_fix_size)
78
83
// reduce iterations, as this benchmark is slower than others
79
- ->Iterations(50000 );
84
+ ->Iterations(50000 )
85
+ ->Apply(&singlethreaded);
80
86
81
87
UMF_BENCHMARK_TEMPLATE_DEFINE (multiple_malloc_free_benchmark, disjoint_pool_fix,
82
88
fixed_alloc_size,
@@ -89,8 +95,9 @@ UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
89
95
disjoint_pool_uniform, uniform_alloc_size,
90
96
pool_allocator<disjoint_pool<os_provider>>);
91
97
UMF_BENCHMARK_REGISTER_F (multiple_malloc_free_benchmark, disjoint_pool_uniform)
92
- ->Apply(&default_multiple_alloc_uniform_size);
93
- // TODO: enable
98
+ ->Apply(&default_multiple_alloc_uniform_size)
99
+ ->Apply(&singlethreaded);
100
+ // TODO: change to multithreaded
94
101
// ->Apply(&multithreaded);
95
102
96
103
#ifdef UMF_POOL_JEMALLOC_ENABLED
0 commit comments