From 618df26a6b0ff3d5eecb68bdedac83fe09674e3c Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Thu, 3 Nov 2022 16:44:27 +0100 Subject: [PATCH 1/2] Make mimalloc the default allocator --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f79dc5d43..e5f141f74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,7 +155,7 @@ endif() # Generic build options set(DEFAULT_MALLOC "system") if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") - set(DEFAULT_MALLOC "tcmalloc") + set(DEFAULT_MALLOC "mimalloc") endif() if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") @@ -179,7 +179,7 @@ endif() pika_option( PIKA_WITH_MALLOC STRING - "Define which allocator should be linked in. Options are: system, tcmalloc, jemalloc, mimalloc, tbbmalloc, and custom (default: tcmalloc)" + "Define which allocator should be linked in. Options are: system, tcmalloc, jemalloc, mimalloc, tbbmalloc, and custom (default: ${DEFAULT_MALLOC})" ${DEFAULT_MALLOC} STRINGS "system;tcmalloc;jemalloc;mimalloc;tbbmalloc;custom" ) From ad16114c0ee0817d7efcf2155a6ea0378f2153b1 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Thu, 3 Nov 2022 16:50:48 +0100 Subject: [PATCH 2/2] Add message recommending environment variables for mimalloc --- cmake/pika_setup_allocator.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/pika_setup_allocator.cmake b/cmake/pika_setup_allocator.cmake index 5e358edc4..f7adb3b51 100644 --- a/cmake/pika_setup_allocator.cmake +++ b/cmake/pika_setup_allocator.cmake @@ -90,6 +90,10 @@ if(NOT TARGET pika_dependencies_allocator) ) endif() set(_use_custom_allocator TRUE) + + pika_warn( + "pika is using mimalloc as the allocator. Typically, exporting the following environment variables will further improve performance: MIMALLOC_EAGER_COMMIT_DELAY=0 and MIMALLOC_LARGE_OS_PAGES=1." + ) endif() # ##########################################################################