Skip to content

Commit

Permalink
perf: side effects when there aren't too many optimizable dependencies (
Browse files Browse the repository at this point in the history
  • Loading branch information
ahabhgk authored Dec 18, 2024
1 parent d3ebbc0 commit e60bd61
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 149 deletions.
8 changes: 4 additions & 4 deletions crates/rspack_core/src/exports_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1307,9 +1307,9 @@ impl ExportInfo {
false
}

pub fn move_target<'a>(
&'a self,
mg: &'a mut ModuleGraph<'a>,
pub fn move_target(
&self,
mg: &mut ModuleGraph,
resolve_filter: ResolveFilterFnTy,
update_original_connection: UpdateOriginalFunctionTy,
) -> Option<ResolvedExportInfoTarget> {
Expand Down Expand Up @@ -1896,7 +1896,7 @@ impl MaybeDynamicTargetExportInfo {
}
}

pub type ResolveFilterFnTy = Rc<dyn Fn(&ResolvedExportInfoTarget, &ModuleGraph) -> bool>;
pub type ResolveFilterFnTy<'a> = Rc<dyn Fn(&ResolvedExportInfoTarget, &ModuleGraph) -> bool + 'a>;

fn resolve_target(
input_target: Option<UnResolvedExportInfoTarget>,
Expand Down
Loading

2 comments on commit e60bd61

@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 ❌ failure
_selftest ✅ success
rsdoctor ❌ failure
rspress ✅ success
rslib ✅ success
rsbuild ❌ failure
examples ❌ failure
devserver ✅ success
nuxt ✅ 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-12-18 8a7084e) Current Change
10000_big_production-mode_disable-minimize + exec 37.9 s ± 525 ms 37.5 s ± 493 ms -0.89 %
10000_development-mode + exec 1.86 s ± 24 ms 1.83 s ± 22 ms -1.75 %
10000_development-mode_hmr + exec 683 ms ± 26 ms 686 ms ± 39 ms +0.39 %
10000_production-mode + exec 2.45 s ± 80 ms 2.41 s ± 49 ms -1.48 %
arco-pro_development-mode + exec 1.79 s ± 95 ms 1.77 s ± 75 ms -1.17 %
arco-pro_development-mode_hmr + exec 378 ms ± 1.1 ms 378 ms ± 1.2 ms -0.09 %
arco-pro_production-mode + exec 3.26 s ± 89 ms 3.28 s ± 119 ms +0.45 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.32 s ± 126 ms 3.31 s ± 81 ms -0.06 %
arco-pro_production-mode_traverse-chunk-modules + exec 3.29 s ± 91 ms 3.28 s ± 89 ms -0.32 %
threejs_development-mode_10x + exec 1.64 s ± 20 ms 1.64 s ± 46 ms +0.15 %
threejs_development-mode_10x_hmr + exec 817 ms ± 17 ms 820 ms ± 36 ms +0.39 %
threejs_production-mode_10x + exec 5.4 s ± 134 ms 5.36 s ± 81 ms -0.69 %
10000_big_production-mode_disable-minimize + rss memory 9531 MiB ± 380 MiB 9554 MiB ± 324 MiB +0.24 %
10000_development-mode + rss memory 671 MiB ± 19.2 MiB 692 MiB ± 20.3 MiB +3.22 %
10000_development-mode_hmr + rss memory 1494 MiB ± 296 MiB 1482 MiB ± 294 MiB -0.82 %
10000_production-mode + rss memory 644 MiB ± 24.1 MiB 698 MiB ± 24.1 MiB +8.25 %
arco-pro_development-mode + rss memory 572 MiB ± 28.6 MiB 611 MiB ± 38.8 MiB +6.85 %
arco-pro_development-mode_hmr + rss memory 623 MiB ± 53.8 MiB 644 MiB ± 46.9 MiB +3.36 %
arco-pro_production-mode + rss memory 774 MiB ± 49.9 MiB 746 MiB ± 45 MiB -3.56 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 752 MiB ± 54.9 MiB 756 MiB ± 52.5 MiB +0.55 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 774 MiB ± 82.3 MiB 763 MiB ± 45.6 MiB -1.43 %
threejs_development-mode_10x + rss memory 654 MiB ± 29.2 MiB 687 MiB ± 28.3 MiB +5.17 %
threejs_development-mode_10x_hmr + rss memory 1203 MiB ± 127 MiB 1230 MiB ± 130 MiB +2.29 %
threejs_production-mode_10x + rss memory 971 MiB ± 66.9 MiB 984 MiB ± 52.9 MiB +1.35 %

Please sign in to comment.