Skip to content

Commit d979d79

Browse files
committed
Enable tracking provider in the benchmark of the proxy pool
The proxy pool requires the tracking provider to work correctly, because it takes the size of the allocation from the tracking provider to use it in umfMemoryProviderFree(ptr, size). Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 02c6895 commit d979d79

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
6161
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
6262
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
63-
-DUMF_ENABLE_POOL_TRACKING=OFF
63+
-DUMF_ENABLE_POOL_TRACKING=ON
6464
6565
- name: Build UMF on Linux
6666
if: matrix.os == 'ubuntu-latest'

benchmark/ubench.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ UBENCH_EX(simple, proxy_pool_with_os_memory_provider) {
196196
}
197197

198198
umf_memory_pool_handle_t proxy_pool;
199+
// the proxy pool requires the tracking provider to work correctly
199200
umf_result = umfPoolCreate(umfProxyPoolOps(), os_memory_provider, NULL, 0,
200201
&proxy_pool);
201202
if (umf_result != UMF_RESULT_SUCCESS) {
@@ -238,8 +239,10 @@ UBENCH_EX(simple, disjoint_pool_with_os_memory_provider) {
238239
disjoint_memory_pool_params.MinBucketSize = DISJOINT_POOL_MIN_BUCKET_SIZE;
239240

240241
umf_memory_pool_handle_t disjoint_pool;
241-
umf_result = umfPoolCreate(umfDisjointPoolOps(), os_memory_provider,
242-
&disjoint_memory_pool_params, 0, &disjoint_pool);
242+
// disable the tracking provider to make it work faster (UMF_POOL_CREATE_FLAG_DISABLE_TRACKING)
243+
umf_result = umfPoolCreate(
244+
umfDisjointPoolOps(), os_memory_provider, &disjoint_memory_pool_params,
245+
UMF_POOL_CREATE_FLAG_DISABLE_TRACKING, &disjoint_pool);
243246
if (umf_result != UMF_RESULT_SUCCESS) {
244247
exit(-1);
245248
}
@@ -274,8 +277,10 @@ UBENCH_EX(simple, jemalloc_pool_with_os_memory_provider) {
274277
}
275278

276279
umf_memory_pool_handle_t jemalloc_pool;
277-
umf_result = umfPoolCreate(umfJemallocPoolOps(), os_memory_provider, NULL,
278-
0, &jemalloc_pool);
280+
// disable the tracking provider to make it work faster (UMF_POOL_CREATE_FLAG_DISABLE_TRACKING)
281+
umf_result =
282+
umfPoolCreate(umfJemallocPoolOps(), os_memory_provider, NULL,
283+
UMF_POOL_CREATE_FLAG_DISABLE_TRACKING, &jemalloc_pool);
279284
if (umf_result != UMF_RESULT_SUCCESS) {
280285
exit(-1);
281286
}
@@ -310,8 +315,10 @@ UBENCH_EX(simple, scalable_pool_with_os_memory_provider) {
310315
}
311316

312317
umf_memory_pool_handle_t scalable_pool;
313-
umf_result = umfPoolCreate(umfScalablePoolOps(), os_memory_provider, NULL,
314-
0, &scalable_pool);
318+
// disable the tracking provider to make it work faster (UMF_POOL_CREATE_FLAG_DISABLE_TRACKING)
319+
umf_result =
320+
umfPoolCreate(umfScalablePoolOps(), os_memory_provider, NULL,
321+
UMF_POOL_CREATE_FLAG_DISABLE_TRACKING, &scalable_pool);
315322
if (umf_result != UMF_RESULT_SUCCESS) {
316323
exit(-1);
317324
}

0 commit comments

Comments
 (0)