Skip to content

Commit 7cff2a6

Browse files
authored
Add a feature flag no-job-core-pinning (#4046)
# Description of Changes Anther knob for benchmarking only without job core pinning but keeping other core pinning (tokio background, rayon, etc.). # API and ABI breaking changes None # Expected complexity level and risk 1 # Testing No semantic changes.
1 parent 4a4bb0c commit 7cff2a6

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

crates/core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ test = ["spacetimedb-commitlog/test", "spacetimedb-datastore/test"]
145145
perfmap = []
146146
# Disables core pinning
147147
no-core-pinning = []
148+
no-job-core-pinning = []
148149

149150
[dev-dependencies]
150151
spacetimedb-lib = { path = "../lib", features = ["proptest", "test"] }

crates/core/src/util/jobs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl JobCores {
125125
/// and runs all databases in the `global_runtime`.
126126
pub fn from_pinned_cores(cores: impl IntoIterator<Item = CoreId>, global_runtime: runtime::Handle) -> Self {
127127
let cores: IndexMap<_, _> = cores.into_iter().map(|id| (id, CoreInfo::spawn_executor(id))).collect();
128-
let inner = if cores.is_empty() {
128+
let inner = if cfg!(feature = "no-job-core-pinning") || cores.is_empty() {
129129
JobCoresInner::NoPinning(global_runtime)
130130
} else {
131131
JobCoresInner::PinnedCores(Arc::new(Mutex::new(PinnedCoresExecutorManager {

crates/standalone/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ unstable = ["spacetimedb-client-api/unstable"]
2222
perfmap = ["spacetimedb-core/perfmap"]
2323
# Disables core pinning
2424
no-core-pinning = ["spacetimedb-core/no-core-pinning"]
25+
no-job-core-pinning = ["spacetimedb-core/no-job-core-pinning"]
2526

2627
[dependencies]
2728
spacetimedb-client-api-messages.workspace = true

0 commit comments

Comments
 (0)