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

Make getReferencedBundle faster #7416

Merged
merged 4 commits into from Dec 14, 2021
Merged

Make getReferencedBundle faster #7416

merged 4 commits into from Dec 14, 2021

Conversation

devongovett
Copy link
Member

Previously, we traversed through all bundles in the bundle group to find a resolved bundle but this is unnecessary since we have direct reference edges between dependencies and bundles. One test is skipped because it actually results in a bundle being deleted but the referenced dependency not being deleted, which ends up with two <script> tags pointing to the same src. That's broken in several ways already, so it can be addressed separately. All other tests are passing but would be good to verify in some larger apps.

In my tests, it makes applyRuntimes significantly faster:

Before:
Screen Shot 2021-12-06 at 2 20 30 PM

After:
Screen Shot 2021-12-07 at 9 06 23 AM

@height
Copy link

height bot commented Dec 7, 2021

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@parcel-benchmark
Copy link

parcel-benchmark commented Dec 7, 2021

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.89s +15.00ms
Cached 316.00ms +11.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 248.00ms -298.00ms 🚀
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 249.00ms -297.00ms 🚀
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 249.00ms -297.00ms 🚀
dist/legacy/index.96016b08.js 1.59kb +0.00b 782.00ms -40.00ms 🚀
dist/legacy/index.8aaa89c9.js 1.20kb +0.00b 782.00ms -40.00ms 🚀

React HackerNews ✅

Timings

Description Time Difference
Cold 9.49s -2.00ms
Cached 445.00ms -6.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/logo.c5bb83f1.png 246.00b +0.00b 5.00s +588.00ms ⚠️

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.02m -1.49s
Cached 1.50s +30.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/editorView.124f5fc0.js 594.92kb +0.00b 34.42s -12.46s 🚀
dist/popup.64bc9a82.js 209.67kb +0.00b 34.42s -12.46s 🚀
dist/Toolbar.1af0e801.js 107.23kb +0.00b 34.42s -12.46s 🚀
dist/Modal.cd71eaf3.js 45.33kb +0.00b 34.42s -12.46s 🚀
dist/ui.5d3f7adc.js 14.94kb +0.00b 34.42s -12.47s 🚀
dist/smartMediaEditor.48c8cf63.js 13.25kb +0.00b 34.42s -12.46s 🚀
dist/dropzone.39132d0c.js 12.16kb +0.00b 34.42s -12.46s 🚀
dist/EmojiPickerComponent.0482d6c0.js 3.73kb +0.00b 34.42s -12.48s 🚀
dist/dropzone.55bef257.js 3.29kb +0.00b 34.42s -12.46s 🚀
dist/clipboard.df70240c.js 2.93kb +0.00b 34.42s -12.46s 🚀
dist/ResourcedEmojiComponent.667554b4.js 2.12kb +0.00b 34.42s -12.48s 🚀
dist/browser.4e039ed7.js 1.69kb +0.00b 34.42s -12.46s 🚀
dist/media-card-analytics-error-boundary.c718a9a7.js 1.12kb +0.00b 34.42s -12.46s 🚀
dist/media-picker-analytics-error-boundary.8b2547e5.js 966.00b +0.00b 34.42s -12.46s 🚀
dist/simpleHasher.fc0d6100.js 643.00b +0.00b 34.42s -12.48s 🚀

Cached Bundles

No bundle changes detected.

Three.js ✅

Timings

Description Time Difference
Cold 6.62s +98.00ms
Cached 373.00ms +2.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@devongovett devongovett merged commit 68ceb55 into v2 Dec 14, 2021
@devongovett devongovett deleted the getreferencedbundle-perf branch December 14, 2021 00:43
bhovhannes pushed a commit to bhovhannes/parcel that referenced this pull request Dec 23, 2021
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

2 participants