Skip to content

explicitly declare single threaded benchmark #1140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions benchmark/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ static void multithreaded(benchmark::internal::Benchmark *benchmark) {
benchmark->Threads(1);
}

static void singlethreaded(benchmark::internal::Benchmark *benchmark) {
benchmark->Threads(1);
}

static void
default_multiple_alloc_fix_size(benchmark::internal::Benchmark *benchmark) {
benchmark->Args({10000, 1, 4096});
Expand Down Expand Up @@ -68,15 +72,17 @@ UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark, proxy_pool,
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark, proxy_pool)
->Apply(&default_multiple_alloc_fix_size)
// reduce iterations, as this benchmark is slower than others
->Iterations(50000);
->Iterations(50000)
->Apply(&singlethreaded);

UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark, os_provider,
fixed_alloc_size,
provider_allocator<os_provider>);
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark, os_provider)
->Apply(&default_multiple_alloc_fix_size)
// reduce iterations, as this benchmark is slower than others
->Iterations(50000);
->Iterations(50000)
->Apply(&singlethreaded);

UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark, disjoint_pool_fix,
fixed_alloc_size,
Expand All @@ -89,8 +95,9 @@ UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
disjoint_pool_uniform, uniform_alloc_size,
pool_allocator<disjoint_pool<os_provider>>);
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark, disjoint_pool_uniform)
->Apply(&default_multiple_alloc_uniform_size);
// TODO: enable
->Apply(&default_multiple_alloc_uniform_size)
->Apply(&singlethreaded);
// TODO: change to multithreaded
//->Apply(&multithreaded);

#ifdef UMF_POOL_JEMALLOC_ENABLED
Expand Down
Loading