Skip to content

Conversation

@SyMind
Copy link
Member

@SyMind SyMind commented Oct 21, 2025

Summary

Related links

Checklist

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

@SyMind SyMind requested a review from LingyuCoder as a code owner October 21, 2025 10:38
Copilot AI review requested due to automatic review settings October 21, 2025 10:38
@netlify
Copy link

netlify bot commented Oct 21, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 630928e
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68f9c66dd0931f0008f7dc63

@SyMind SyMind marked this pull request as draft October 21, 2025 10:38
@github-actions github-actions bot added release: performance release: performance related release(mr only) team The issue/pr is created by the member of Rspack. labels Oct 21, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves performance when parsing source maps from JSON by updating the rspack_sources dependency and adapting the codebase to use a new iterator-based API instead of the previous collection-based approach.

Key changes:

  • Updates rspack_sources dependency to use a git revision with performance improvements
  • Refactors code to use iterator methods (sources(), get_source_content()) instead of collection methods (sources().iter(), sources_content().get())
  • Changes SourceMap::from_slice() calls to SourceMap::from_json() for more efficient parsing

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Cargo.toml Updates rspack_sources dependency to git revision with performance improvements
crates/rspack_plugin_rsdoctor/src/module_graph.rs Refactors to use iterator-based source access methods
crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs Removes unnecessary .iter() calls on sources iterator
crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs Removes .iter() call for sources iteration
crates/rspack_loader_swc/src/lib.rs Removes .iter() call for sources iteration
crates/rspack_core/src/utils/extract_source_map.rs Changes sources collection to use iterator with explicit mapping
crates/rspack_cacheable/src/with/as_preset/rspack_sources/mod.rs Removes unnecessary reference in conditional binding
crates/rspack_binding_api/src/swc.rs Replaces JSON serialization with to_json() method
crates/rspack_binding_api/src/source.rs Replaces from_slice() with more efficient from_json() method

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

ropey = { version = "1.6.1", default-features = false }
rspack_resolver = { features = ["package_json_raw_json_api", "yarn_pnp"], version = "0.6.3", default-features = false }
rspack_sources = { version = "=0.4.11", default-features = false }
rspack_sources = { git = "https://github.com/SyMind/rspack-sources.git", rev = "1cbefbd08acf0225a9eae9bb4e01084b6886f650", default-features = false }
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a git dependency with a specific commit instead of a versioned release makes the build less reproducible and harder to audit. Consider publishing this change as a new version of rspack_sources (e.g., 0.4.12) and using a semver dependency instead.

Suggested change
rspack_sources = { git = "https://github.com/SyMind/rspack-sources.git", rev = "1cbefbd08acf0225a9eae9bb4e01084b6886f650", default-features = false }
rspack_sources = { version = "0.4.12", default-features = false }

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

📦 Binary Size-limit

Comparing 630928e to chore(ci): set timeout for pnpm setup action (#11976) by pshu

❌ Size increased by 13.88KB from 47.82MB to 47.83MB (⬆️0.03%)

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 21, 2025

CodSpeed Performance Report

Merging #11950 will not alter performance

Comparing perf-source-map-json-parse (630928e) with main (e0e2e12)

Summary

✅ 17 untouched

@SyMind SyMind force-pushed the perf-source-map-json-parse branch 2 times, most recently from 7b5e493 to 29e9cbd Compare October 21, 2025 12:58
@web-infra-dev web-infra-dev deleted a comment from github-actions bot Oct 22, 2025
@web-infra-dev web-infra-dev deleted a comment from github-actions bot Oct 22, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

📝 Benchmark detail: Open

Name Base (2025-10-23 e28e40e) Current Change
10000_big_production-mode_disable-minimize + exec 27.7 s ± 1.2 s 27.5 s ± 756 ms -0.47 %
10000_development-mode + exec 1.34 s ± 31 ms 1.32 s ± 36 ms -1.91 %
10000_development-mode_hmr + exec 667 ms ± 7.8 ms 654 ms ± 5.2 ms -1.97 %
10000_development-mode_noop-loader + exec 2.28 s ± 57 ms 2.27 s ± 52 ms -0.43 %
10000_production-mode + exec 1.49 s ± 50 ms 1.43 s ± 30 ms -4.18 %
10000_production-mode_persistent-cold + exec 1.65 s ± 51 ms 1.58 s ± 36 ms -4.73 %
10000_production-mode_persistent-hot + exec 1.18 s ± 52 ms 1.12 s ± 21 ms -5.32 %
arco-pro_development-mode + exec 1.59 s ± 76 ms 1.62 s ± 94 ms +2.24 %
arco-pro_development-mode_hmr + exec 365 ms ± 0.63 ms 364 ms ± 0.72 ms -0.20 %
arco-pro_production-mode + exec 3.09 s ± 81 ms 3.06 s ± 105 ms -0.95 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.14 s ± 85 ms 3.15 s ± 156 ms +0.25 %
arco-pro_production-mode_persistent-cold + exec 3.18 s ± 62 ms 3.14 s ± 81 ms -1.50 %
arco-pro_production-mode_persistent-hot + exec 1.81 s ± 59 ms 1.77 s ± 75 ms -2.34 %
arco-pro_production-mode_traverse-chunk-modules + exec 3.12 s ± 165 ms 3.03 s ± 86 ms -2.90 %
large-dyn-imports_development-mode + exec 1.62 s ± 119 ms 1.54 s ± 22 ms -4.57 %
large-dyn-imports_production-mode + exec 1.68 s ± 27 ms 1.6 s ± 22 ms -4.73 %
threejs_development-mode_10x + exec 1.34 s ± 56 ms 1.33 s ± 32 ms -0.16 %
threejs_development-mode_10x_hmr + exec 920 ms ± 11 ms 923 ms ± 14 ms +0.33 %
threejs_production-mode_10x + exec 4.36 s ± 152 ms 4.32 s ± 49 ms -1.04 %
threejs_production-mode_10x_persistent-cold + exec 4.51 s ± 260 ms 4.47 s ± 103 ms -1.02 %
threejs_production-mode_10x_persistent-hot + exec 4.01 s ± 234 ms 3.96 s ± 137 ms -1.24 %
10000_big_production-mode_disable-minimize + rss memory 8740 MiB ± 36.6 MiB 8807 MiB ± 172 MiB +0.76 %
10000_development-mode + rss memory 655 MiB ± 27 MiB 673 MiB ± 17.2 MiB +2.73 %
10000_development-mode_hmr + rss memory 813 MiB ± 17.3 MiB 827 MiB ± 21.9 MiB +1.80 %
10000_development-mode_noop-loader + rss memory 957 MiB ± 29.7 MiB 968 MiB ± 9.4 MiB +1.10 %
10000_production-mode + rss memory 669 MiB ± 36.7 MiB 676 MiB ± 10.8 MiB +1.06 %
10000_production-mode_persistent-cold + rss memory 756 MiB ± 22.1 MiB 769 MiB ± 9.94 MiB +1.72 %
10000_production-mode_persistent-hot + rss memory 738 MiB ± 17.7 MiB 770 MiB ± 27.8 MiB +4.26 %
arco-pro_development-mode + rss memory 538 MiB ± 37.2 MiB 582 MiB ± 75.7 MiB +8.21 %
arco-pro_development-mode_hmr + rss memory 433 MiB ± 13.9 MiB 458 MiB ± 16.7 MiB +5.87 %
arco-pro_production-mode + rss memory 669 MiB ± 123 MiB 711 MiB ± 130 MiB +6.21 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 705 MiB ± 136 MiB 705 MiB ± 66.3 MiB +0.03 %
arco-pro_production-mode_persistent-cold + rss memory 756 MiB ± 55.6 MiB 759 MiB ± 78.1 MiB +0.39 %
arco-pro_production-mode_persistent-hot + rss memory 572 MiB ± 76.4 MiB 586 MiB ± 102 MiB +2.51 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 697 MiB ± 64.7 MiB 702 MiB ± 85.3 MiB +0.72 %
large-dyn-imports_development-mode + rss memory 696 MiB ± 12 MiB 712 MiB ± 9.71 MiB +2.26 %
large-dyn-imports_production-mode + rss memory 622 MiB ± 16.2 MiB 647 MiB ± 4.62 MiB +3.98 %
threejs_development-mode_10x + rss memory 577 MiB ± 18.1 MiB 645 MiB ± 17 MiB +11.69 %
threejs_development-mode_10x_hmr + rss memory 796 MiB ± 26.1 MiB 849 MiB ± 67.7 MiB +6.60 %
threejs_production-mode_10x + rss memory 814 MiB ± 196 MiB 807 MiB ± 209 MiB -0.94 %
threejs_production-mode_10x_persistent-cold + rss memory 841 MiB ± 35.4 MiB 869 MiB ± 17.3 MiB +3.30 %
threejs_production-mode_10x_persistent-hot + rss memory 701 MiB ± 39.1 MiB 714 MiB ± 40.7 MiB +1.80 %

@web-infra-dev web-infra-dev deleted a comment from github-actions bot Oct 23, 2025
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.

2 participants