mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Increase the size of the rayon pool and try to make slowjobs a little
friendlier.
This commit is contained in:
parent
f17910ed2a
commit
b489d1ac84
@ -569,6 +569,11 @@ impl SlowJobPool {
|
||||
// times or something in case we have more tasks to execute).
|
||||
return;
|
||||
};
|
||||
// Hint to scheduler to run any other threads that are currently waiting, since
|
||||
// slowjobs are, well, slow :) i.e. the cost of yielding should be very small
|
||||
// compared to the cost of actually running the job for *almost* every job on the
|
||||
// pool (and for jobs for which this isn't true, we should probably batch them up).
|
||||
std::thread::yield_now();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -106,10 +106,10 @@ impl State {
|
||||
GameMode::Client => "c",
|
||||
GameMode::Singleplayer => "sp",
|
||||
};
|
||||
let rayon_threads = match game_mode {
|
||||
let rayon_threads = /*match game_mode {
|
||||
GameMode::Server | GameMode::Client => num_cpu / 2,
|
||||
GameMode::Singleplayer => num_cpu / 4,
|
||||
}/*num_cpu*/.max(common::consts::MIN_RECOMMENDED_RAYON_THREADS);
|
||||
}*/num_cpu.max(common::consts::MIN_RECOMMENDED_RAYON_THREADS);
|
||||
let rayon_pool = Arc::new(
|
||||
ThreadPoolBuilder::new()
|
||||
.num_threads(rayon_threads)
|
||||
|
Loading…
x
Reference in New Issue
Block a user