Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rolldown/hash): caculate hash by scanning actually used dependencies and also prevent hash collision from different chunks that have the same content #1141

Merged
merged 4 commits into from
May 16, 2024

Conversation

hyf0
Copy link
Member

@hyf0 hyf0 commented May 16, 2024

Description

  • Calculate chunk's dependencies by scanning !~{xxx}~ that contained in rendered chunk code.
  • Prevent different chunks that have same content from having the same hash

Copy link
Member Author

hyf0 commented May 16, 2024

Copy link

netlify bot commented May 16, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 1518b03
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/6645d7b7d4340c0008ad7fb1

Copy link

codecov bot commented May 16, 2024

Codecov Report

Attention: Patch coverage is 92.50000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 86.95%. Comparing base (a9f27d4) to head (1518b03).
Report is 3 commits behind head on main.

Files Patch % Lines
crates/rolldown/src/chunk_graph.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1141      +/-   ##
==========================================
+ Coverage   86.83%   86.95%   +0.12%     
==========================================
  Files         121      122       +1     
  Lines        6000     6018      +18     
==========================================
+ Hits         5210     5233      +23     
+ Misses        790      785       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented May 16, 2024

Benchmarks Rust

  • target: main(6909e84)
  • pr: 05-16-chore_test_fix_filename_with_hash_(3aeb5f4)
group                                      pr                                     target
-----                                      --                                     ------
rolldown benchmark/threejs-bundle          1.00     30.1±0.39ms        ? ?/sec    1.03     31.1±1.30ms        ? ?/sec
rolldown benchmark/threejs-scan            1.01     21.0±0.48ms        ? ?/sec    1.00     20.9±0.11ms        ? ?/sec
rolldown benchmark/threejs-sourcemap       1.01     42.1±2.36ms        ? ?/sec    1.00     41.8±1.13ms        ? ?/sec
rolldown benchmark/threejs10x-bundle       1.00    315.8±2.69ms        ? ?/sec    1.01    318.5±4.74ms        ? ?/sec
rolldown benchmark/threejs10x-scan         1.02    209.9±5.80ms        ? ?/sec    1.00    206.1±2.11ms        ? ?/sec
rolldown benchmark/threejs10x-sourcemap    1.00   447.9±12.02ms        ? ?/sec    1.01    451.4±8.24ms        ? ?/sec

Benchmarks Rust

  • target: main(6909e84)
  • pr: 05-16-chore_test_fix_filename_with_hash_(24ed2ea)
group                                      pr                                     target
-----                                      --                                     ------
rolldown benchmark/threejs-bundle          1.00     29.8±0.38ms        ? ?/sec    1.00     29.8±0.49ms        ? ?/sec
rolldown benchmark/threejs-scan            1.05     21.5±0.35ms        ? ?/sec    1.00     20.5±0.52ms        ? ?/sec
rolldown benchmark/threejs-sourcemap       1.04     42.1±2.10ms        ? ?/sec    1.00     40.6±1.02ms        ? ?/sec
rolldown benchmark/threejs10x-bundle       1.03    321.5±7.84ms        ? ?/sec    1.00    311.3±2.60ms        ? ?/sec
rolldown benchmark/threejs10x-scan         1.01    209.4±2.53ms        ? ?/sec    1.00    206.6±2.49ms        ? ?/sec
rolldown benchmark/threejs10x-sourcemap    1.02   457.6±19.08ms        ? ?/sec    1.00   446.6±10.44ms        ? ?/sec

Benchmarks Rust

  • target: main(6909e84)
  • pr: 05-16-chore_test_fix_filename_with_hash_(1518b03)
group                                      pr                                     target
-----                                      --                                     ------
rolldown benchmark/threejs-bundle          1.00     29.8±0.33ms        ? ?/sec    1.02     30.3±0.57ms        ? ?/sec
rolldown benchmark/threejs-scan            1.00     21.5±0.76ms        ? ?/sec    1.00     21.5±1.44ms        ? ?/sec
rolldown benchmark/threejs-sourcemap       1.00     41.5±1.01ms        ? ?/sec    1.01     42.1±0.84ms        ? ?/sec
rolldown benchmark/threejs10x-bundle       1.00    315.4±2.88ms        ? ?/sec    1.01    318.8±2.81ms        ? ?/sec
rolldown benchmark/threejs10x-scan         1.00    208.6±2.36ms        ? ?/sec    1.00    208.6±2.11ms        ? ?/sec
rolldown benchmark/threejs10x-sourcemap    1.00   448.7±11.54ms        ? ?/sec    1.02   458.0±12.12ms        ? ?/sec

Copy link

codspeed-hq bot commented May 16, 2024

CodSpeed Performance Report

Merging #1141 will not alter performance

Comparing 05-16-chore_test_fix_filename_with_hash_ (1518b03) with main (6909e84)

Summary

✅ 6 untouched benchmarks

IWANABETHATGUY
IWANABETHATGUY previously approved these changes May 16, 2024
@IWANABETHATGUY IWANABETHATGUY added this pull request to the merge queue May 16, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 16, 2024
…ies and also prevent hash collision from different chunks that have the same content
@hyf0 hyf0 changed the title chore(test): fix filename_with_hash fix(rolldown/hash): caculate hash by scanning actually used dependencies and also prevent hash collision from different chunks that have the same content May 16, 2024
@hyf0 hyf0 merged commit 130013b into main May 16, 2024
27 checks passed
@hyf0 hyf0 deleted the 05-16-chore_test_fix_filename_with_hash_ branch May 16, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants