-
Notifications
You must be signed in to change notification settings - Fork 465
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
Allow force enabling jemalloc on macOS #27067
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# generated by ci/test/lint-deps.sh -- see ci/test/lint-deps/README.md for details | ||
tikv_jemalloc_ctl | ||
0::default,jemalloc,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:mz_prof:jemalloc,tikv-jemalloc-ctl | ||
3:tikv_jemalloc_ctl:default,use_std | ||
tikv_jemallocator | ||
0::default,jemalloc,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
tikv_jemalloc_sys | ||
0::default,jemalloc,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:mz_prof:jemalloc,tikv-jemalloc-ctl | ||
3:tikv_jemalloc_ctl:default,use_std | ||
4:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
3:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms (*) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# generated by ci/test/lint-deps.sh -- see ci/test/lint-deps/README.md for details | ||
tikv_jemalloc_ctl | ||
0::default,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:mz_prof:jemalloc,tikv-jemalloc-ctl | ||
3:tikv_jemalloc_ctl:default,use_std | ||
tikv_jemallocator | ||
0::default,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
tikv_jemalloc_sys | ||
0::default,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:mz_prof:jemalloc,tikv-jemalloc-ctl | ||
3:tikv_jemalloc_ctl:default,use_std | ||
4:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
3:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms (*) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# generated by ci/test/lint-deps.sh -- see ci/test/lint-deps/README.md for details | ||
tikv_jemalloc_ctl | ||
0::default,jemalloc,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:mz_prof:jemalloc,tikv-jemalloc-ctl | ||
3:tikv_jemalloc_ctl:default,use_std | ||
tikv_jemallocator | ||
0::default,jemalloc,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
tikv_jemalloc_sys | ||
0::default,jemalloc,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:mz_prof:jemalloc,tikv-jemalloc-ctl | ||
3:tikv_jemalloc_ctl:default,use_std | ||
4:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
3:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms (*) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# generated by ci/test/lint-deps.sh -- see ci/test/lint-deps/README.md for details |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# generated by ci/test/lint-deps.sh -- see ci/test/lint-deps/README.md for details | ||
tikv_jemalloc_ctl | ||
0::default,jemalloc,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:mz_prof:jemalloc,tikv-jemalloc-ctl | ||
3:tikv_jemalloc_ctl:default,use_std | ||
tikv_jemallocator | ||
0::default,jemalloc,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
tikv_jemalloc_sys | ||
0::default,jemalloc,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:mz_prof:jemalloc,tikv-jemalloc-ctl | ||
3:tikv_jemalloc_ctl:default,use_std | ||
4:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
3:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms (*) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
# generated by ci/test/lint-deps.sh -- see ci/test/lint-deps/README.md for details | ||
tikv_jemalloc_ctl | ||
0:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
1:mz_prof:default,jemalloc,tikv-jemalloc-ctl,workspace-hack | ||
2:tikv_jemalloc_ctl:default,use_std | ||
0::default,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:mz_prof:jemalloc,tikv-jemalloc-ctl | ||
3:tikv_jemalloc_ctl:default,use_std | ||
tikv_jemallocator | ||
0:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
1:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
0::default,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
tikv_jemalloc_sys | ||
0::default,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:mz_prof:jemalloc,tikv-jemalloc-ctl | ||
3:tikv_jemalloc_ctl:default,use_std | ||
4:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
3:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms (*) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# generated by ci/test/lint-deps.sh -- see ci/test/lint-deps/README.md for details | ||
tikv_jemalloc_ctl | ||
0::default,jemalloc,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:mz_prof:jemalloc,tikv-jemalloc-ctl | ||
3:tikv_jemalloc_ctl:default,use_std | ||
tikv_jemallocator | ||
0::default,jemalloc,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
tikv_jemalloc_sys | ||
0::default,jemalloc,mz-alloc-default,tokio-console | ||
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack | ||
2:mz_prof:jemalloc,tikv-jemalloc-ctl | ||
3:tikv_jemalloc_ctl:default,use_std | ||
4:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms | ||
3:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms (*) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[package] | ||
name = "mz-alloc-default" | ||
description = "Activates the best default global memory allocator for the platform." | ||
version = "0.0.0" | ||
edition.workspace = true | ||
rust-version.workspace = true | ||
publish = false | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[dependencies] | ||
mz-alloc = { path = "../alloc", default-features = false } | ||
workspace-hack = { version = "0.0.0", path = "../workspace-hack", optional = true } | ||
|
||
# We use jemalloc by default on non-macOS platforms, as benchmarks indicated it | ||
# outperforms the system allocator, while also providing heap profiles. | ||
# | ||
# However, on macOS, we default to the system allocator, as jemalloc is not well | ||
# supported on macOS [0][1][2]. The issues present as runaway latency on load | ||
# test workloads that are comfortably handled by the macOS system allocator. | ||
# Consider re-evaluating if jemalloc's macOS support improves. | ||
# | ||
# [0]: https://github.com/jemalloc/jemalloc/issues/26 | ||
# [1]: https://github.com/jemalloc/jemalloc/issues/843 | ||
# [2]: https://github.com/jemalloc/jemalloc/issues/1467 | ||
# | ||
# Furthermore, as of August 2022, some engineers are using profiling tools, e.g. | ||
# `heaptrack`, that only work with the system allocator on macOS. | ||
[target.'cfg(not(target_os = "macos"))'.dependencies] | ||
mz-alloc = { path = "../alloc", features = ["jemalloc"] } | ||
Comment on lines
+30
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fascinating that cargo correctly overrides the default dep here! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, when they implemented target-specific dependencies, they actually did all the hard work to support target-specific features, too. This is why they rolled out that What they didn't do is the last mile to allow saying The good news is that I'm convinced every target-specific feature can be represented as a target-specific dependency with one or more indirection crates. Just can be annoyingly tricky to figure out how to do the transformation. |
||
|
||
[features] | ||
default = ["workspace-hack"] | ||
|
||
[package.metadata.cargo-udeps.ignore] | ||
normal = ["workspace-hack", "mz-alloc"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright Materialize, Inc. and contributors. All rights reserved. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the LICENSE file. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0. | ||
|
||
//! Activates the best default global memory allocator for the platform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh neat, this didn't work when I wrote the script!