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

Merge all native Rust modules into one package #9146

Merged
merged 7 commits into from
Sep 11, 2023
Merged

Conversation

devongovett
Copy link
Member

This merges all of our native Rust modules into a single package, @parcel/rust (name TBD). Rather than publishing separate packages to npm, each with a separate binary (per platform), this will combine all of them together into one binary. That way the binary size should be reduced due to avoiding duplicate Rust crates, and we can simplify our publishing step once we start publishing each platform as its own package to reduce install size. It will also enable future things such as sharing a Rust thread pool between different modules.

For WASM this also unifies all of our packages around napi-wasm, which means we don't need a separate wasm-bindgen backend.

To do

  • Test WASM

Copy link
Contributor

@marcins marcins left a comment

Choose a reason for hiding this comment

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

I don't really have a grasp on all the allocator/WASM related changes, but the other bits seem pretty good to me - with one comment where I noticed oxipng was an older version that I bumped to very recently, so the branch likely needs to be refreshed.


[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
parcel-dev-dep-resolver = { path = "../../packages/utils/dev-dep-resolver" }
oxipng = "6.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

I recently bumped oxipng to 8.0.0 to resolve a compilation issue on one of the architectures - have you rebased recently on the latest v2 changes?

# Conflicts:
#	packages/core/core/src/Parcel.js
#	packages/core/core/src/requests/AssetGraphRequest.js
#	packages/packagers/js/src/index.js
@parcel-benchmark
Copy link

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.50s +54.00ms
Cached 260.00ms +21.00ms ⚠️

Cold Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 242.00ms +13.00ms ⚠️
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 242.00ms +14.00ms ⚠️
dist/legacy/index.8692583b.js 1.48kb +0.00b 342.00ms +25.00ms ⚠️
dist/legacy/index.a2819fc3.js 1.06kb +0.00b 342.00ms +25.00ms ⚠️
dist/modern/index.d90ef1a6.js 917.00b +0.00b 342.00ms +26.00ms ⚠️
dist/legacy/index.html 826.00b +0.00b 367.00ms +28.00ms ⚠️
dist/modern/index.html 749.00b +0.00b 367.00ms +29.00ms ⚠️

Cached Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 230.00ms +13.00ms ⚠️
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 236.00ms +18.00ms ⚠️
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 237.00ms +19.00ms ⚠️
dist/legacy/index.b8ae99ba.css 94.00b +0.00b 253.00ms +27.00ms ⚠️
dist/modern/index.31cedca9.css 94.00b +0.00b 253.00ms +27.00ms ⚠️

React HackerNews ✅

Timings

Description Time Difference
Cold 3.90s -96.00ms
Cached 372.00ms -1.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/PermalinkedComment.3145598b.js 3.94kb +0.00b 316.00ms -41.00ms 🚀
dist/UserProfile.b37bbaff.js 1.38kb +0.00b 315.00ms -42.00ms 🚀
dist/NotFound.c08212ea.js 265.00b +0.00b 315.00ms -41.00ms 🚀
dist/logo.8dd07848.png 244.00b +0.00b 226.00ms -62.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/PermalinkedComment.3145598b.js 3.94kb +0.00b 324.00ms -36.00ms 🚀
dist/UserProfile.b37bbaff.js 1.38kb +0.00b 323.00ms -36.00ms 🚀
dist/NotFound.c08212ea.js 265.00b +0.00b 323.00ms -37.00ms 🚀
dist/logo.8dd07848.png 244.00b +0.00b 231.00ms -64.00ms 🚀

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 34.33s -417.00ms
Cached 1.98s +24.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/media-viewer.bc1a2415.js 537.32kb +0.00b 7.60s -434.00ms 🚀
dist/ConfigPanelFieldsLoader.8648eeee.js 306.81kb +0.00b 7.61s -434.00ms 🚀
dist/card.3521c96b.js 140.18kb +0.00b 7.60s -434.00ms 🚀
dist/ConfigPanelFieldsLoader.1a016f33.js 82.96kb +0.00b 9.38s -1.42s 🚀
dist/ElementBrowser.c496dd44.js 62.20kb +0.00b 7.61s -434.00ms 🚀
dist/archive.fe044de4.js 60.16kb +0.00b 7.60s -3.21s 🚀
dist/esm.ce3e12df.js 59.72kb +0.00b 7.60s -436.00ms 🚀
dist/ConfigPanelFieldsLoader.8efb299e.js 15.82kb +0.00b 7.61s -434.00ms 🚀
dist/ui.8e1e1200.js 14.49kb +0.00b 7.61s -434.00ms 🚀
dist/ConfigPanelFieldsLoader.f78f3b60.js 13.65kb +0.00b 7.61s -434.00ms 🚀
dist/pdfRenderer.6335b9a2.js 12.08kb +0.00b 7.60s -434.00ms 🚀
dist/mobile-upload.c687ddb2.js 7.86kb +0.00b 7.61s -434.00ms 🚀
dist/mobile-upload.e9eb996a.js 7.86kb +0.00b 7.61s -434.00ms 🚀
dist/media-viewer-analytics-error-boundary.54c54975.js 3.19kb +0.00b 9.38s -1.41s 🚀
dist/uk.5d2e97bd.js 2.76kb +0.00b 7.61s -435.00ms 🚀
dist/codeViewerRenderer.7d374cd5.js 2.61kb +0.00b 7.60s -434.00ms 🚀
dist/th.df60823c.js 2.60kb +0.00b 7.60s -435.00ms 🚀
dist/vi.3e6d5bcb.js 2.09kb +0.00b 7.61s -435.00ms 🚀
dist/tr.4de346b9.js 2.03kb +0.00b 7.61s -435.00ms 🚀
dist/sv.b893ead3.js 1.97kb +0.00b 7.60s -435.00ms 🚀
dist/zh_TW.3d130b76.js 1.85kb +0.00b 7.61s -435.00ms 🚀
dist/zh.fb21f066.js 1.83kb +0.00b 7.61s -435.00ms 🚀
dist/workerHasher.322762e4.js 1.56kb +0.00b 7.61s -434.00ms 🚀
dist/workerHasher.8fdadeba.js 1.56kb +0.00b 7.61s -434.00ms 🚀
dist/heading3.82217cc7.js 1.35kb +0.00b 5.26s +308.00ms ⚠️
dist/heading5.20183aa6.js 1.23kb +0.00b 5.26s +308.00ms ⚠️
dist/sk.1a0c584e.js 652.00b +0.00b 7.60s -435.00ms 🚀
dist/simpleHasher.0488d56a.js 585.00b +0.00b 7.61s -434.00ms 🚀
dist/simpleHasher.180c1d91.js 585.00b +0.00b 7.61s -434.00ms 🚀
dist/ro.ee42c980.js 478.00b +0.00b 5.32s -2.31s 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/media-viewer.bc1a2415.js 537.32kb +0.00b 9.97s -593.00ms 🚀
dist/component-lazy.aeb22f50.js 59.50kb +0.00b 5.33s +569.00ms ⚠️
dist/pdfRenderer.6335b9a2.js 12.08kb +0.00b 9.97s +2.51s ⚠️
dist/codeViewerRenderer.7d374cd5.js 2.61kb +0.00b 9.97s +2.51s ⚠️
dist/pt_BR.1db6fd92.js 2.06kb +0.00b 7.05s +1.73s ⚠️
dist/ro.ee42c980.js 478.00b +0.00b 7.32s +2.00s ⚠️

Three.js ✅

Timings

Description Time Difference
Cold 2.96s -41.00ms
Cached 310.00ms +8.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/Three.js 572.22kb +0.00b 902.00ms -69.00ms 🚀

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@devongovett devongovett merged commit 2792324 into v2 Sep 11, 2023
16 checks passed
@devongovett devongovett deleted the rust-bindings branch September 11, 2023 01:34
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.

None yet

3 participants