Skip to content

Commit 68df8e8

Browse files
Remove nice -n -20 (requires root); keep taskset for CPU pinning
Co-authored-by: NullVoxPopuli <[email protected]>
1 parent 9496d17 commit 68df8e8

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

scripts/bench-compare.mjs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,27 +105,17 @@ try {
105105
CONTROL_DIR,
106106
];
107107

108-
// CPU pinning + process priority on Linux
108+
// CPU pinning on Linux to reduce cross-core migration variance
109109
const IS_LINUX = process.platform === 'linux';
110110
const HAS_TASKSET = IS_LINUX && spawnSync('which', ['taskset'], { stdio: 'pipe' }).status === 0;
111-
const HAS_NICE = IS_LINUX && spawnSync('which', ['nice'], { stdio: 'pipe' }).status === 0;
112111

113112
let cmd = 'node';
114113
let fullArgs = benchArgs;
115114

116-
if (HAS_TASKSET && HAS_NICE) {
117-
// nice -n -20: highest priority; taskset -c 0: pin to CPU 0
118-
cmd = 'nice';
119-
fullArgs = ['-n', '-20', 'taskset', '-c', '0', 'node', ...benchArgs];
120-
console.error('📌 CPU pinning + high priority enabled (nice -n -20 taskset -c 0)\n');
121-
} else if (HAS_TASKSET) {
115+
if (HAS_TASKSET) {
122116
cmd = 'taskset';
123117
fullArgs = ['-c', '0', 'node', ...benchArgs];
124118
console.error('📌 CPU pinning enabled (taskset -c 0)\n');
125-
} else if (HAS_NICE) {
126-
cmd = 'nice';
127-
fullArgs = ['-n', '-20', 'node', ...benchArgs];
128-
console.error('📌 High priority enabled (nice -n -20)\n');
129119
}
130120

131121
const result = spawnSync(cmd, fullArgs, {

0 commit comments

Comments
 (0)