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

perf: reduce allocation for adding dependencies #7301

Merged
merged 1 commit into from
Jul 24, 2024
Merged

Conversation

h-a-n-a
Copy link
Collaborator

@h-a-n-a h-a-n-a commented Jul 24, 2024

Summary

(Also the heavy computation)

Dependency paths returned from oxc-resolver had already been normalized.
See: https://github.com/oxc-project/oxc-resolver/blob/f4c3ef5b4765ec8fcfb0f0d74a7562a6baa1456c/src/lib.rs#L380

Reduced memory cost by about 28.7% (at peak) for the case of 10000 modules (Rspack was compiled with debug profile).

Before:
img_v3_02d3_ac33769d-7e05-409d-b613-ef293732b7eg

After:
img_v3_02d3_02b6b4ec-5889-4c24-839d-6e57f984ea9g

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@h-a-n-a
Copy link
Collaborator Author

h-a-n-a commented Jul 24, 2024

!bench

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: performance release: performance related release(mr only) labels Jul 24, 2024
@rspack-bot
Copy link

rspack-bot commented Jul 24, 2024

📝 Benchmark detail: Open

Name Base (2024-07-24 5392167) Current Change
10000_development-mode exec 2.26 s ± 28 ms 2.21 s ± 31 ms -2.30 %
10000_development-mode_hmr exec 691 ms ± 6.4 ms 696 ms ± 8.3 ms 0.65 %
10000_production-mode exec 2.87 s ± 22 ms 2.78 s ± 28 ms -3.24 %
arco-pro_development-mode exec 1.93 s ± 62 ms 1.9 s ± 78 ms -1.69 %
arco-pro_development-mode_hmr exec 433 ms ± 1.7 ms 433 ms ± 1.2 ms 0.06 %
arco-pro_production-mode exec 3.5 s ± 66 ms 3.42 s ± 69 ms -2.39 %
threejs_development-mode_10x exec 1.75 s ± 23 ms 1.75 s ± 19 ms -0.25 %
threejs_development-mode_10x_hmr exec 856 ms ± 5.1 ms 856 ms ± 4.3 ms -0.06 %
threejs_production-mode_10x exec 5.74 s ± 44 ms 5.72 s ± 28 ms -0.24 %

@h-a-n-a h-a-n-a requested review from ahabhgk and JSerFeng July 24, 2024 14:39
@h-a-n-a h-a-n-a enabled auto-merge (squash) July 24, 2024 14:40
@h-a-n-a h-a-n-a merged commit b6cf473 into main Jul 24, 2024
40 checks passed
@h-a-n-a h-a-n-a deleted the perf-normalize branch July 24, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: performance release: performance related release(mr only) team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants