Skip to content

Commit

Permalink
EXPERIMENT: [C++] Always prefer mimalloc to jemalloc
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed May 28, 2024
1 parent e6e00e7 commit dc1a9bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 8 additions & 10 deletions cpp/src/arrow/memory_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,17 @@ struct SupportedBackend {

const std::vector<SupportedBackend>& SupportedBackends() {
static std::vector<SupportedBackend> backends = {
// ARROW-12316: Apple => mimalloc first, then jemalloc
// non-Apple => jemalloc first, then mimalloc
#if defined(ARROW_JEMALLOC) && !defined(__APPLE__)
{"jemalloc", MemoryPoolBackend::Jemalloc},
#endif
// mimalloc is our preferred allocator for several reasons:
// 1) it has good performance
// 2) it is well-supported on all our main platforms (Linux, macOS, Windows)
// 3) it is easy to configure and has a consistent API.
#ifdef ARROW_MIMALLOC
{"mimalloc", MemoryPoolBackend::Mimalloc},
{"mimalloc", MemoryPoolBackend::Mimalloc},
#endif
#if defined(ARROW_JEMALLOC) && defined(__APPLE__)
{"jemalloc", MemoryPoolBackend::Jemalloc},
#ifdef ARROW_JEMALLOC
{"jemalloc", MemoryPoolBackend::Jemalloc},
#endif
{"system", MemoryPoolBackend::System}
};
{"system", MemoryPoolBackend::System}};
return backends;
}

Expand Down
2 changes: 2 additions & 0 deletions dev/archery/archery/benchmark/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ def default_configuration(**kwargs):
with_csv=True,
with_dataset=True,
with_json=True,
with_jemalloc=True,
with_mimalloc=True,
with_parquet=True,
with_python=False,
with_brotli=True,
Expand Down

0 comments on commit dc1a9bf

Please sign in to comment.