preload: --jobs / VICTORY_PRELOAD_JOBS to leave the rest of the PC free
The preload passed no thread count to any of its three steps, so it took every core to translate and two thirds of them to make pipelines, with no way to play or work beside it. `victory preload --jobs N` (or the switch VICTORY_PRELOAD_JOBS=N, which the launcher's -More and the F1 menu's restart carry) now gives each step N threads or processes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FsQtBz4aDhUTip3jBagKEX (cherry picked from commit 3692a28bd7e561abd133495873543150f389aad8)
This commit is contained in:
1 parent
4e533e79ee
commit
761de52baf
1 file changed
+16
-4
@@ -300,6 +300,11 @@ enum Command {
|
||||
Preload {
|
||||
/// The title's folder (default: the configured game folder).
|
||||
paths: Vec<PathBuf>,
|
||||
/// Threads and processes for each of its steps, to leave the rest of
|
||||
/// the PC free (default: `VICTORY_PRELOAD_JOBS`, else each step's
|
||||
/// own: every core to translate, two thirds of them to make).
|
||||
#[arg(long)]
|
||||
jobs: Option<usize>,
|
||||
},
|
||||
/// Play: the title with this fork's settings, as a start with no
|
||||
/// command at all does (a double click on the program beside the
|
||||
@@ -475,11 +480,18 @@ fn main() -> Result<()> {
|
||||
#[cfg(windows)]
|
||||
Command::Warm { jobs, limit, again, used, these } => warm::run(jobs, limit, again, used, these),
|
||||
#[cfg(windows)]
|
||||
Command::Preload { paths } => {
|
||||
Command::Preload { paths, jobs } => {
|
||||
// The launcher and the F1 menu's restart pass it as a switch.
|
||||
let jobs = jobs
|
||||
.or_else(|| std::env::var("VICTORY_PRELOAD_JOBS").ok()?.trim().parse().ok())
|
||||
.filter(|&n| n > 0);
|
||||
if let Some(n) = jobs {
|
||||
println!("Preloading on {n} threads at a time (VICTORY_PRELOAD_JOBS / --jobs).");
|
||||
}
|
||||
play::explain_preload();
|
||||
translate::precompile(paths, None)?;
|
||||
warm::run(None, None, false, false, None)?;
|
||||
warm::into_library(None)
|
||||
translate::precompile(paths, jobs)?;
|
||||
warm::run(jobs, None, false, false, None)?;
|
||||
warm::into_library(jobs)
|
||||
}
|
||||
#[cfg(windows)]
|
||||
Command::Play(_) => unreachable!("handled above"),
|
||||
|
||||
Reference in new issue
Block a user