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

refactor: simplify file system code #8654

Merged
merged 7 commits into from
Dec 11, 2024

Conversation

nilptr
Copy link
Contributor

@nilptr nilptr commented Dec 10, 2024

Summary

cherry pick refactor changes in #8643

  • refactor: Unify the return values of ThreadsafeNodeFS methods into promises to simplify the code
  • refactor: change fn <'a>() -> BoxFuture<'a, Result<()>>; to async fn() -> Result<()>
  • refactor: remove unnecessary async blocks
  • refactor(rspack_fs_node): create map_error_to_fs_error util to replace duplicate closures
  • refactor(rspack_fs_node): create new_fs_error to simplify code
  • fix: NodeFileStats lacks the is_symlink field

Checklist

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

Copy link

netlify bot commented Dec 10, 2024

Deploy Preview for rspack canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 04c2036
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/6759000ae7f31900084475fa

@nilptr nilptr force-pushed the nilptr/refactor/file-system branch from 8f4ed07 to 04c2036 Compare December 11, 2024 02:59
@hardfist
Copy link
Contributor

!bench

@rspack-bot
Copy link

rspack-bot commented Dec 11, 2024

📝 Benchmark detail: Open

Name Base (2024-12-11 6a5b766) Current Change
10000_big_production-mode_disable-minimize + exec 37.6 s ± 447 ms 37.5 s ± 558 ms -0.19 %
10000_development-mode + exec 1.79 s ± 22 ms 1.79 s ± 22 ms -0.31 %
10000_development-mode_hmr + exec 659 ms ± 21 ms 658 ms ± 15 ms -0.10 %
10000_production-mode + exec 2.33 s ± 29 ms 2.35 s ± 28 ms +1.01 %
arco-pro_development-mode + exec 1.76 s ± 82 ms 1.76 s ± 68 ms -0.01 %
arco-pro_development-mode_hmr + exec 424 ms ± 1.1 ms 424 ms ± 1.3 ms +0.03 %
arco-pro_production-mode + exec 3.13 s ± 79 ms 3.12 s ± 67 ms -0.52 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.15 s ± 56 ms 3.14 s ± 46 ms -0.29 %
arco-pro_production-mode_traverse-chunk-modules + exec 3.11 s ± 78 ms 3.12 s ± 81 ms +0.37 %
threejs_development-mode_10x + exec 1.61 s ± 18 ms 1.63 s ± 15 ms +0.70 %
threejs_development-mode_10x_hmr + exec 785 ms ± 21 ms 792 ms ± 16 ms +0.88 %
threejs_production-mode_10x + exec 4.87 s ± 23 ms 4.9 s ± 57 ms +0.52 %
10000_big_production-mode_disable-minimize + rss memory 9699 MiB ± 36.6 MiB 9736 MiB ± 148 MiB +0.39 %
10000_development-mode + rss memory 836 MiB ± 66.1 MiB 811 MiB ± 24.5 MiB -2.99 %
10000_development-mode_hmr + rss memory 1925 MiB ± 184 MiB 1933 MiB ± 326 MiB +0.42 %
10000_production-mode + rss memory 712 MiB ± 54.4 MiB 681 MiB ± 26.2 MiB -4.24 %
arco-pro_development-mode + rss memory 721 MiB ± 27.3 MiB 715 MiB ± 36 MiB -0.93 %
arco-pro_development-mode_hmr + rss memory 927 MiB ± 73 MiB 915 MiB ± 39.7 MiB -1.31 %
arco-pro_production-mode + rss memory 829 MiB ± 65.1 MiB 819 MiB ± 46 MiB -1.19 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 801 MiB ± 26.3 MiB 818 MiB ± 50.8 MiB +2.13 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 832 MiB ± 51.2 MiB 826 MiB ± 49 MiB -0.74 %
threejs_development-mode_10x + rss memory 768 MiB ± 34.8 MiB 769 MiB ± 47.6 MiB +0.18 %
threejs_development-mode_10x_hmr + rss memory 1585 MiB ± 286 MiB 1668 MiB ± 332 MiB +5.23 %
threejs_production-mode_10x + rss memory 1104 MiB ± 60.4 MiB 1140 MiB ± 74.2 MiB +3.27 %

@hardfist hardfist merged commit 96e2777 into web-infra-dev:main Dec 11, 2024
32 checks passed
@hardfist
Copy link
Contributor

thanks again for your great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants