Skip to content

Commit

Permalink
fix: progress bar draw interval (#6291)
Browse files Browse the repository at this point in the history
* fix: progress bar draw interval

* fix: progress bar draw interval
  • Loading branch information
LingyuCoder authored Apr 19, 2024
1 parent 0f0ecdf commit 400e2e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/rspack_plugin_progress/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ pub struct ProgressPlugin {

impl ProgressPlugin {
pub fn new(options: ProgressPluginOptions) -> Self {
let progress_bar = ProgressBar::with_draw_target(Some(100), ProgressDrawTarget::stdout());
// 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));
progress_bar.set_style(
ProgressStyle::with_template(
"● {prefix:.bold} {bar:25.green/white.dim} ({percent}%) {wide_msg:.dim}",
Expand Down

2 comments on commit 400e2e2

@rspack-bot
Copy link

Choose a reason for hiding this comment

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

📝 Ran ecosystem CI: Open

suite result
modernjs, self-hosted, Linux, ci ❌ failure
_selftest, ubuntu-latest ✅ success
nx, ubuntu-latest ✅ success
rspress, ubuntu-latest ✅ success
rsbuild, ubuntu-latest ✅ success
compat, ubuntu-latest ✅ success
examples, ubuntu-latest ✅ success

@rspack-bot
Copy link

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-04-19 25c7594) Current Change
10000_development-mode + exec 2.66 s ± 20 ms 2.68 s ± 29 ms +0.54 %
10000_development-mode_hmr + exec 681 ms ± 6.4 ms 684 ms ± 4.2 ms +0.38 %
10000_production-mode + exec 2.47 s ± 19 ms 2.51 s ± 17 ms +1.96 %
arco-pro_development-mode + exec 2.51 s ± 55 ms 2.46 s ± 63 ms -2.21 %
arco-pro_development-mode_hmr + exec 430 ms ± 2.1 ms 429 ms ± 3.3 ms -0.11 %
arco-pro_development-mode_hmr_intercept-plugin + exec 440 ms ± 3.4 ms 439 ms ± 3.6 ms -0.21 %
arco-pro_development-mode_intercept-plugin + exec 3.2 s ± 64 ms 3.21 s ± 77 ms +0.17 %
arco-pro_production-mode + exec 3.94 s ± 84 ms 3.98 s ± 90 ms +0.93 %
arco-pro_production-mode_intercept-plugin + exec 4.7 s ± 79 ms 4.77 s ± 91 ms +1.48 %
threejs_development-mode_10x + exec 2.05 s ± 15 ms 2.05 s ± 17 ms -0.12 %
threejs_development-mode_10x_hmr + exec 746 ms ± 16 ms 744 ms ± 5.6 ms -0.20 %
threejs_production-mode_10x + exec 5.16 s ± 43 ms 5.18 s ± 43 ms +0.39 %

Please sign in to comment.