Make core pinning explicit opt-in; disabled by default

This commit is contained in:
joshua-spacetime
2026-05-05 20:51:15 -07:00
parent b71df6bb69
commit 6d5c283edd
4 changed files with 7 additions and 9 deletions
+2 -3
View File
@@ -146,9 +146,8 @@ spacetimedb-wasm-instance-env-times = []
test = ["spacetimedb-commitlog/test", "spacetimedb-datastore/test"]
# Perfmaps for profiling modules
perfmap = []
# Disables core pinning
no-core-pinning = []
no-job-core-pinning = []
# Enables core pinning.
core-pinning = []
[dev-dependencies]
spacetimedb-lib = { path = "../lib", features = ["proptest", "test"] }
+2 -2
View File
@@ -319,10 +319,10 @@ impl Cores {
/// Get the cores of the local host, as reported by the operating system.
///
/// Returns `None` if `num_cpus` is less than 8
/// or if core pinning is disabled.
/// or if core pinning is not enabled.
/// If `Some` is returned, the `Vec` is non-empty.
pub fn get_core_ids() -> Option<Vec<CoreId>> {
if cfg!(feature = "no-core-pinning") {
if cfg!(not(feature = "core-pinning")) {
return None;
}
+1 -1
View File
@@ -86,7 +86,7 @@ impl JobCores {
/// and runs all databases in the `global_runtime`.
pub fn from_pinned_cores(cores: impl IntoIterator<Item = CoreId>) -> Self {
let cores: IndexMap<_, _> = cores.into_iter().map(|id| (id, CoreInfo::default())).collect();
let inner = if cfg!(feature = "no-job-core-pinning") || cores.is_empty() {
let inner = if cfg!(not(feature = "core-pinning")) || cores.is_empty() {
JobCoresInner::NoPinning
} else {
JobCoresInner::PinnedCores(Arc::new(Mutex::new(PinnedCoresExecutorManager {
+2 -3
View File
@@ -21,9 +21,8 @@ unstable = ["spacetimedb-client-api/unstable"]
allow_loopback_http_for_tests = ["spacetimedb-core/allow_loopback_http_for_tests"]
# Perfmaps for profiling modules
perfmap = ["spacetimedb-core/perfmap"]
# Disables core pinning
no-core-pinning = ["spacetimedb-core/no-core-pinning"]
no-job-core-pinning = ["spacetimedb-core/no-job-core-pinning"]
# Enables core pinning.
core-pinning = ["spacetimedb-core/core-pinning"]
[dependencies]
spacetimedb-client-api-messages.workspace = true