Skip to content

Commit

Permalink
fix: chunk hash unstable (#7534)
Browse files Browse the repository at this point in the history
  • Loading branch information
JSerFeng authored Aug 12, 2024
1 parent cf41f17 commit 58b48b8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/rspack_plugin_runtime/src/helpers.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::hash::Hash;

use rspack_collections::{IdentifierLinkedMap, UkeySet};
use rspack_collections::{IdentifierLinkedMap, UkeyIndexSet};
use rspack_core::{
get_chunk_from_ukey, get_chunk_group_from_ukey, get_js_chunk_filename_template,
rspack_sources::{BoxSource, RawSource, SourceExt},
Expand Down Expand Up @@ -53,14 +53,14 @@ pub fn get_all_chunks(
exclude_chunk1: &ChunkUkey,
exclude_chunk2: Option<&ChunkUkey>,
chunk_group_by_ukey: &ChunkGroupByUkey,
) -> UkeySet<ChunkUkey> {
) -> UkeyIndexSet<ChunkUkey> {
fn add_chunks(
chunk_group_by_ukey: &ChunkGroupByUkey,
chunks: &mut UkeySet<ChunkUkey>,
chunks: &mut UkeyIndexSet<ChunkUkey>,
entrypoint_ukey: &ChunkGroupUkey,
exclude_chunk1: &ChunkUkey,
exclude_chunk2: Option<&ChunkUkey>,
visit_chunk_groups: &mut UkeySet<ChunkGroupUkey>,
visit_chunk_groups: &mut UkeyIndexSet<ChunkGroupUkey>,
) {
if let Some(entrypoint) = get_chunk_group_from_ukey(entrypoint_ukey, chunk_group_by_ukey) {
for chunk in &entrypoint.chunks {
Expand Down Expand Up @@ -96,8 +96,8 @@ pub fn get_all_chunks(
}
}

let mut chunks: UkeySet<ChunkUkey> = UkeySet::default();
let mut visit_chunk_groups = UkeySet::default();
let mut chunks = UkeyIndexSet::default();
let mut visit_chunk_groups = UkeyIndexSet::default();

add_chunks(
chunk_group_by_ukey,
Expand Down

2 comments on commit 58b48b8

@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
nx ❌ failure
rspress ✅ success
rsbuild ✅ success
examples ✅ 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-08-12 a7844d9) Current Change
10000_development-mode + exec 2.31 s ± 26 ms 2.31 s ± 24 ms -0.27 %
10000_development-mode_hmr + exec 697 ms ± 10 ms 700 ms ± 12 ms +0.43 %
10000_production-mode + exec 2.86 s ± 21 ms 2.85 s ± 17 ms -0.44 %
arco-pro_development-mode + exec 1.86 s ± 57 ms 1.89 s ± 88 ms +1.50 %
arco-pro_development-mode_hmr + exec 433 ms ± 1.1 ms 433 ms ± 2.1 ms -0.02 %
arco-pro_production-mode + exec 3.45 s ± 74 ms 3.45 s ± 120 ms -0.19 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.54 s ± 88 ms 3.53 s ± 83 ms -0.43 %
threejs_development-mode_10x + exec 1.7 s ± 12 ms 1.71 s ± 11 ms +0.45 %
threejs_development-mode_10x_hmr + exec 821 ms ± 5.6 ms 814 ms ± 10 ms -0.82 %
threejs_production-mode_10x + exec 5.48 s ± 32 ms 5.48 s ± 22 ms +0.14 %

Please sign in to comment.