Skip to content

Commit

Permalink
chore: prevent clone when create ModuleIdentifier (#8330)
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind authored Nov 4, 2024
1 parent 6779f98 commit 1f08e37
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ fn eval_source_map_devtool_plugin_render_module_content(
let modules = sources.iter().map(|source| {
if let Some(stripped) = source.strip_prefix("webpack://") {
let source = make_paths_absolute(compilation.options.context.as_str(), stripped);
let identifier = ModuleIdentifier::from(source.clone());
let identifier = ModuleIdentifier::from(source.as_str());
match compilation
.get_module_graph()
.module_by_identifier(&identifier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl ConsumeSharedModule {
Self {
blocks: Vec::new(),
dependencies: Vec::new(),
identifier: ModuleIdentifier::from(identifier.clone()),
identifier: ModuleIdentifier::from(identifier.as_ref()),
lib_ident: format!(
"webpack/sharing/consume/{}/{}{}",
&options.share_scope,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl ProvideSharedModule {
Self {
blocks: Vec::new(),
dependencies: Vec::new(),
identifier: ModuleIdentifier::from(identifier.clone()),
identifier: ModuleIdentifier::from(identifier.as_ref()),
lib_ident: format!("webpack/sharing/provide/{}/{}", &share_scope, &name),
readable_identifier: identifier,
name,
Expand Down

2 comments on commit 1f08e37

@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
rspress ✅ success
rslib ✅ success
rsbuild ❌ failure
examples ❌ failure
devserver ✅ 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-11-04 a987332) Current Change
10000_big_production-mode + exec 45.9 s ± 613 ms 43.4 s ± 1.52 s -5.59 %
10000_development-mode + exec 1.84 s ± 17 ms 1.84 s ± 19 ms -0.02 %
10000_development-mode_hmr + exec 645 ms ± 12 ms 647 ms ± 8.9 ms +0.27 %
10000_production-mode + exec 2.4 s ± 19 ms 2.42 s ± 35 ms +0.87 %
arco-pro_development-mode + exec 1.79 s ± 63 ms 1.78 s ± 78 ms -0.54 %
arco-pro_development-mode_hmr + exec 429 ms ± 1.2 ms 429 ms ± 1.2 ms +0.11 %
arco-pro_production-mode + exec 3.19 s ± 87 ms 3.2 s ± 89 ms +0.45 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.27 s ± 50 ms 3.24 s ± 75 ms -0.69 %
threejs_development-mode_10x + exec 1.58 s ± 7.7 ms 1.58 s ± 24 ms +0.01 %
threejs_development-mode_10x_hmr + exec 784 ms ± 4.2 ms 778 ms ± 11 ms -0.73 %
threejs_production-mode_10x + exec 4.93 s ± 40 ms 4.94 s ± 39 ms +0.12 %

Please sign in to comment.