Skip to content

Commit

Permalink
fix: add stdout draw target to multi progress (#8889)
Browse files Browse the repository at this point in the history
  • Loading branch information
LingyuCoder authored Dec 30, 2024
1 parent 3074092 commit 99fc4cd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/rspack_plugin_progress/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ impl std::fmt::Debug for ProgressPluginOptions {
}
}

static MULTI_PROGRESS: LazyLock<MultiProgress> = LazyLock::new(MultiProgress::new);
static MULTI_PROGRESS: LazyLock<MultiProgress> =
LazyLock::new(|| MultiProgress::with_draw_target(ProgressDrawTarget::stdout_with_hz(100)));
#[derive(Debug, Default)]
pub struct ProgressPluginDisplayOptions {
// the prefix name of progress bar
Expand Down Expand Up @@ -83,8 +84,7 @@ impl ProgressPlugin {
ProgressPluginOptions::Handler(_fn) => None,
ProgressPluginOptions::Default(options) => {
// default interval is 20, means draw every 1000/20 = 50ms, use 100 to draw every 1000/100 = 10ms
let progress_bar =
ProgressBar::with_draw_target(Some(100), ProgressDrawTarget::stdout_with_hz(100));
let progress_bar = MULTI_PROGRESS.add(ProgressBar::new(100));

let mut progress_bar_style = ProgressStyle::with_template(&options.template)
.expect("TODO:")
Expand All @@ -102,7 +102,6 @@ impl ProgressPlugin {
Some(progress_bar)
}
};
let progress_bar = progress_bar.map(|x| MULTI_PROGRESS.add(x));
Self::new_inner(
options,
progress_bar,
Expand Down

1 comment on commit 99fc4cd

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented on 99fc4cd Dec 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Benchmark detail: Open

Name Base (2024-12-30 437c370) Current Change
10000_big_production-mode_disable-minimize + exec 37.5 s ± 658 ms 38.1 s ± 378 ms +1.61 %
10000_development-mode + exec 1.89 s ± 22 ms 1.83 s ± 26 ms -3.31 %
10000_development-mode_hmr + exec 685 ms ± 15 ms 674 ms ± 13 ms -1.61 %
10000_production-mode + exec 2.49 s ± 46 ms 2.48 s ± 65 ms -0.50 %
arco-pro_development-mode + exec 1.75 s ± 76 ms 1.76 s ± 88 ms +0.52 %
arco-pro_development-mode_hmr + exec 378 ms ± 3.8 ms 377 ms ± 1.4 ms -0.14 %
arco-pro_production-mode + exec 3.64 s ± 75 ms 3.6 s ± 83 ms -1.25 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.64 s ± 76 ms 3.58 s ± 92 ms -1.77 %
arco-pro_production-mode_traverse-chunk-modules + exec 3.63 s ± 80 ms 3.58 s ± 97 ms -1.59 %
threejs_development-mode_10x + exec 1.52 s ± 18 ms 1.5 s ± 47 ms -1.05 %
threejs_development-mode_10x_hmr + exec 790 ms ± 8.7 ms 760 ms ± 13 ms -3.85 %
threejs_production-mode_10x + exec 5.34 s ± 72 ms 5.37 s ± 192 ms +0.59 %
10000_big_production-mode_disable-minimize + rss memory 9458 MiB ± 133 MiB 9514 MiB ± 48 MiB +0.59 %
10000_development-mode + rss memory 650 MiB ± 8.03 MiB 699 MiB ± 16.6 MiB +7.43 %
10000_development-mode_hmr + rss memory 1421 MiB ± 196 MiB 1481 MiB ± 188 MiB +4.24 %
10000_production-mode + rss memory 618 MiB ± 21.6 MiB 699 MiB ± 26.5 MiB +13.19 %
arco-pro_development-mode + rss memory 592 MiB ± 24.8 MiB 600 MiB ± 43.1 MiB +1.21 %
arco-pro_development-mode_hmr + rss memory 636 MiB ± 47.2 MiB 639 MiB ± 61.5 MiB +0.42 %
arco-pro_production-mode + rss memory 725 MiB ± 44.8 MiB 735 MiB ± 43.6 MiB +1.40 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 770 MiB ± 58.4 MiB 763 MiB ± 51.4 MiB -0.92 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 750 MiB ± 36.5 MiB 754 MiB ± 47.1 MiB +0.57 %
threejs_development-mode_10x + rss memory 624 MiB ± 24 MiB 659 MiB ± 40 MiB +5.55 %
threejs_development-mode_10x_hmr + rss memory 1173 MiB ± 179 MiB 1153 MiB ± 199 MiB -1.67 %
threejs_production-mode_10x + rss memory 895 MiB ± 49.3 MiB 912 MiB ± 54.2 MiB +1.90 %

Please sign in to comment.