From 8c3706df11abadafec89ef0546d20c79d31ec92b Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Mon, 20 Jan 2025 18:22:35 -0600 Subject: increase number of concurrent tasks --- src/launcher.rs | 2 +- src/launcher/assets.rs | 4 ++-- src/launcher/download.rs | 4 ++-- src/launcher/runner.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/launcher.rs b/src/launcher.rs index f148653..78c429d 100644 --- a/src/launcher.rs +++ b/src/launcher.rs @@ -723,7 +723,7 @@ impl LibraryRepository { Ok(false) })) - .try_buffer_unordered(8) + .try_buffer_unordered(32) .try_fold(0usize, |accum, res| async move { match res { true => Ok(accum + 1), diff --git a/src/launcher/assets.rs b/src/launcher/assets.rs index 271f79e..cd75d0d 100644 --- a/src/launcher/assets.rs +++ b/src/launcher/assets.rs @@ -229,7 +229,7 @@ impl AssetRepository { if self.online { info!("Downloading {} asset objects...", downloads.len()); let client = Client::new(); - MultiDownloader::with_concurrent(downloads.iter_mut(), 16).perform(&client).await + MultiDownloader::with_concurrent(downloads.iter_mut(), 32).perform(&client).await .inspect_err(|e| warn!("asset download failed: {e}")) .try_fold((), |_, _| async {Ok(())}) .await @@ -288,7 +288,7 @@ impl AssetRepository { } } }) - .try_for_each_concurrent(16, |(object, obj_path)| async move { + .try_for_each_concurrent(32, |(object, obj_path)| async move { if let Some(parent) = obj_path.parent() { fs::create_dir_all(parent).await .inspect_err(|e| debug!("Error creating directory for asset object {}: {e}", object.name)) diff --git a/src/launcher/download.rs b/src/launcher/download.rs index f5469d8..4eedba5 100644 --- a/src/launcher/download.rs +++ b/src/launcher/download.rs @@ -87,7 +87,7 @@ impl<'j, T: Download> PhaseDownloadError<'j, T> { impl<'j, T: Download + 'j, I: Iterator> MultiDownloader<'j, T, I> { pub fn new(jobs: I) -> MultiDownloader<'j, T, I> { - Self::with_concurrent(jobs, 8) + Self::with_concurrent(jobs, 24) } pub fn with_concurrent(jobs: I, n: usize) -> MultiDownloader<'j, T, I> { @@ -282,7 +282,7 @@ pub async fn verify_files(files: impl Iterator) -> debug!("Verifying library {}", dl.get_path().display()); util::verify_file(dl.get_path(), dl.get_expect_size(), dl.get_expect_sha1()).await })) - .try_buffer_unordered(8) + .try_buffer_unordered(32) .try_fold((), |_, _| async {Ok(())}) .await } diff --git a/src/launcher/runner.rs b/src/launcher/runner.rs index 8c7af3d..0f65b49 100644 --- a/src/launcher/runner.rs +++ b/src/launcher/runner.rs @@ -111,7 +111,7 @@ pub fn build_arguments<'l, F: FeatureMatcher>(launch: &LaunchInfo<'l, F>, versio } pub fn run_the_game(launch: &Launch) -> Result<(), Box> { - Command::new("/usr/lib/jvm/java-8-openjdk-amd64/bin/java") + Command::new("java") .args(launch.jvm_args.iter() .map(|o| o.as_os_str()) .chain(iter::once(OsStr::new(launch.main_class.as_str()))) -- cgit v1.2.3-70-g09d2