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

[Experimental Bundler]: Implement parallel request limits #7863

Closed
wants to merge 28 commits into from

Conversation

gorakong
Copy link
Member

@gorakong gorakong commented Mar 25, 2022

↪️ Pull Request

Implements parallel request limits in the Experimental Bundler. When creating a shared bundle, only consider source bundles where the bundleGroups they belong to are all within the parallel request limit.

Test Plan

  • Tested against a large app and verified that limit is enforced
  • Verified that there were no test regressions
  • Added an integration test which asserts that # of bundles produced changes from 7 to 2 upon hitting the request limit -- 2 shared bundles (one containing lodash and another react) are removed/merged. (test has already been merged)

@gorakong gorakong changed the title Parallel request limit [Experimental Bundler]: Implement parallel request limits Mar 25, 2022
@parcel-benchmark
Copy link

parcel-benchmark commented Mar 25, 2022

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.51s +5.00ms
Cached 347.00ms -12.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/legacy/index.2c76ad23.js 1.66kb +0.00b 457.00ms +25.00ms ⚠️
dist/legacy/index.8aaa89c9.js 1.20kb +0.00b 457.00ms +26.00ms ⚠️
dist/modern/index.6be20f01.js 1.13kb +0.00b 456.00ms +25.00ms ⚠️

Cached Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 235.00ms -12.00ms 🚀
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 236.00ms -12.00ms 🚀
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 235.00ms -13.00ms 🚀
dist/legacy/index.2c76ad23.js 1.66kb +0.00b 437.00ms -32.00ms 🚀
dist/legacy/index.8aaa89c9.js 1.20kb +0.00b 437.00ms -32.00ms 🚀
dist/modern/index.6be20f01.js 1.13kb +0.00b 437.00ms -32.00ms 🚀
dist/legacy/index.html 826.00b +0.00b 542.00ms -47.00ms 🚀
dist/modern/index.html 749.00b +0.00b 542.00ms -47.00ms 🚀

React HackerNews ✅

Timings

Description Time Difference
Cold 9.31s -69.00ms
Cached 463.00ms -13.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.64m -2.76s
Cached 2.62s -20.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/esm.c7dc1640.js 61.96kb +0.00b 1.21m +31.57s ⚠️
dist/index.html 240.00b +0.00b 1.21m +35.68s ⚠️

Three.js ✅

Timings

Description Time Difference
Cold 6.69s -60.00ms
Cached 270.00ms +7.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@gorakong
Copy link
Member Author

confirmed that these changes don't introduce any test regressions 🙂

@wbinnssmith
Copy link
Contributor

what's the state of this PR?

@wbinnssmith
Copy link
Contributor

@gorakong @devongovett?

@gorakong
Copy link
Member Author

gorakong commented May 3, 2022

@devongovett @wbinnssmith PR has been updated with a Test Plan 🙂

@devongovett devongovett self-assigned this May 9, 2022
@AGawrys
Copy link
Contributor

AGawrys commented May 12, 2022

Would attempting to use default config now allow for the number of bundles to match for the config test? We should get those tests to pass or alter them if we need to dependent on the bundler

Copy link
Contributor

@AGawrys AGawrys left a comment

Choose a reason for hiding this comment

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

I think we need a new test for this since I tested with & without the changes on experimental bundler branch and it doesn't seem like theres any difference

  • Add a new test testing that changing the parallel request limit changes the bundles produced (maybe this should be in cache.js since theres a test already doing something similar for the bundle config, see experimental-bundler-integration branch for updated version of the config tests)

packages/bundlers/experimental/src/ExperimentalBundler.js Outdated Show resolved Hide resolved
@gorakong
Copy link
Member Author

gorakong commented Jun 2, 2022

@AGawrys Changes have also been included in the experimental-bundler-integration branch you mentioned. Verified that all bundler config-related cache tests all pass 🙂

@gorakong gorakong dismissed AGawrys’s stale review July 6, 2022 23:18

Has been resolved -- test has been added.

bundleIds.add(nodeId);
}, bundleGroupId);
bundleGroupToBundles.set(bundleGroupId, bundleIds);
}
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't all bundles in a bundle group be directly attached to the entry bundle node? When is that not the case?

Copy link
Member Author

Choose a reason for hiding this comment

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

It doesn't look like they're connected at this stage yet -- the edges are created in this step of decorateLegacyGraph:
https://github.com/parcel-bundler/parcel/blob/v2/packages/bundlers/experimental/src/ExperimentalBundler.js#L253-L276

@devongovett
Copy link
Member

@gorakong is this superseded by #8303?

@gorakong
Copy link
Member Author

Closing since superseded by #8303 🙂

@gorakong gorakong closed this Jul 19, 2022
@mischnic mischnic deleted the parallel-request-limit branch July 20, 2022 10:52
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

6 participants