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

Limit default number of JS workers to 4 #9300

Merged
merged 1 commit into from
Oct 9, 2023
Merged

Limit default number of JS workers to 4 #9300

merged 1 commit into from
Oct 9, 2023

Conversation

devongovett
Copy link
Member

This limits the default number of JS worker threads to 4, even if there are more CPUs available. Now that we run the JS transformer and resolver in native Rust threads (#9147), the JS threads don't have as much to do. Benchmarking indicates that > 4 JS threads has negligible to negative performance impact, and limiting the number reduces memory usage a lot.

The PARCEL_WORKERS environment variable can still be set to override this if the default doesn't work for a particular project.

Closes #5617. Closes #5072.

@parcel-benchmark
Copy link

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.47s +28.00ms
Cached 296.00ms +47.00ms ⚠️

Cold Bundles

Bundle Size Difference Time Difference
dist/legacy/index.html 826.00b +0.00b 389.00ms +26.00ms ⚠️
dist/modern/index.html 749.00b +0.00b 389.00ms +26.00ms ⚠️
dist/legacy/index.b8ae99ba.css 94.00b +0.00b 269.00ms +18.00ms ⚠️
dist/modern/index.31cedca9.css 94.00b +0.00b 269.00ms +18.00ms ⚠️

Cached Bundles

Bundle Size Difference Time Difference
dist/legacy/index.b8ae99ba.css 94.00b +0.00b 252.00ms -17.00ms 🚀
dist/modern/index.31cedca9.css 94.00b +0.00b 252.00ms -17.00ms 🚀

React HackerNews ✅

Timings

Description Time Difference
Cold 3.88s +16.00ms
Cached 415.00ms +2.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/logo.8dd07848.png 244.00b +0.00b 240.00ms +16.00ms ⚠️

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 31.61s -361.00ms
Cached 2.13s +3.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/refractor.3e0cc31b.js 598.96kb +0.00b 10.16s -592.00ms 🚀
dist/media-viewer.38e3999a.js 536.13kb +0.00b 10.17s +2.38s ⚠️
dist/popup.a77286c1.js 321.45kb +0.00b 10.16s -590.00ms 🚀
dist/ConfigPanelFieldsLoader.182d39bc.js 303.43kb +0.00b 7.05s -752.00ms 🚀
dist/EmojiPickerComponent.4a196252.js 188.61kb +0.00b 10.14s -584.00ms 🚀
dist/card.d06de810.js 138.91kb +0.00b 7.04s -748.00ms 🚀
dist/ConfigPanelFieldsLoader.28b428a5.js 82.73kb +0.00b 10.14s -588.00ms 🚀
dist/esm.34897092.js 62.95kb +0.00b 10.16s -591.00ms 🚀
dist/ElementBrowser.e8f01080.js 61.94kb +0.00b 7.04s -753.00ms 🚀
dist/archive.c374f622.js 59.90kb +0.00b 10.17s +2.38s ⚠️
dist/esm.bfca2115.js 59.30kb +0.00b 7.05s -747.00ms 🚀
dist/component-lazy.51d1dec9.js 58.94kb +0.00b 5.07s +310.00ms ⚠️
dist/esm.5e913efb.js 39.11kb +0.00b 10.16s -590.00ms 🚀
dist/smartMediaEditor.efa59853.js 21.68kb +0.00b 10.17s -581.00ms 🚀
dist/esm.aee9cbf1.js 20.43kb +0.00b 10.17s -581.00ms 🚀
dist/ConfigPanelFieldsLoader.2b7c03be.js 15.74kb +0.00b 7.04s -755.00ms 🚀
dist/ui.8c117104.js 14.48kb +0.00b 7.04s -749.00ms 🚀
dist/ConfigPanelFieldsLoader.5dfde67d.js 13.63kb +0.00b 7.04s -754.00ms 🚀
dist/dropzone.77a8e729.js 13.40kb +0.00b 10.16s -591.00ms 🚀
dist/pdfRenderer.01deafa1.js 12.04kb +0.00b 7.04s -750.00ms 🚀
dist/dropzone.1c15cdc1.js 11.48kb +0.00b 10.16s -591.00ms 🚀
dist/Toolbar.4d256e97.js 9.36kb +0.00b 10.17s -581.00ms 🚀
dist/clipboard.400013a2.js 7.92kb +0.00b 10.16s -591.00ms 🚀
dist/mobile-upload.3baad8e4.js 7.79kb +0.00b 7.05s -747.00ms 🚀
dist/mobile-upload.7a892a37.js 7.79kb +0.00b 7.05s -748.00ms 🚀
dist/mobile-upload.2102debb.js 7.79kb +0.00b 10.17s -581.00ms 🚀
dist/index.runtime.e32c1d2d.js 7.29kb +0.00b 10.19s -569.00ms 🚀
dist/browser.0009c8b4.js 7.19kb +0.00b 10.16s -589.00ms 🚀
dist/index.b16227d6.css 4.08kb +0.00b 10.19s -619.00ms 🚀
dist/media-viewer-analytics-error-boundary.60bdaa4c.js 3.18kb +0.00b 10.17s -582.00ms 🚀
dist/media-picker-analytics-error-boundary.c493f011.js 3.18kb +0.00b 10.16s -589.00ms 🚀
dist/media-card-analytics-error-boundary.74e0c7f9.js 3.18kb +0.00b 10.17s -582.00ms 🚀
dist/ru.0cf3f40e.js 2.81kb +0.00b 7.04s -754.00ms 🚀
dist/uk.282f23b1.js 2.76kb +0.00b 7.04s -755.00ms 🚀
dist/codeViewerRenderer.51140ec8.js 2.61kb +0.00b 10.17s +2.38s ⚠️
dist/th.137e1013.js 2.60kb +0.00b 7.04s -754.00ms 🚀
dist/vi.b46097db.js 2.09kb +0.00b 7.04s -755.00ms 🚀
dist/tr.c85d90a9.js 2.03kb +0.00b 7.04s -754.00ms 🚀
dist/sv.1c06c95c.js 1.98kb +0.00b 7.04s -754.00ms 🚀
dist/zh_TW.b7c55aa6.js 1.86kb +0.00b 7.04s -755.00ms 🚀
dist/zh.b01fe721.js 1.84kb +0.00b 7.04s -755.00ms 🚀
dist/workerHasher.540c9790.js 1.56kb +0.00b 7.04s -753.00ms 🚀
dist/workerHasher.c840c607.js 1.56kb +0.00b 7.05s -747.00ms 🚀
dist/workerHasher.730f3766.js 1.56kb +0.00b 10.16s -591.00ms 🚀
dist/workerHasher.9b1fcdbf.js 1.56kb +0.00b 10.16s -589.00ms 🚀
dist/workerHasher.02b63a21.js 1.56kb +0.00b 10.17s -581.00ms 🚀
dist/sk.4be9c93f.js 656.00b +0.00b 7.04s -754.00ms 🚀
dist/simpleHasher.c14e20b4.js 589.00b +0.00b 7.05s -747.00ms 🚀
dist/simpleHasher.23db7a52.js 589.00b +0.00b 7.05s -747.00ms 🚀
dist/simpleHasher.eefc98b4.js 589.00b +0.00b 10.16s -591.00ms 🚀
dist/simpleHasher.47b9c809.js 589.00b +0.00b 10.16s -590.00ms 🚀
dist/simpleHasher.cadc19c6.js 589.00b +0.00b 10.17s -581.00ms 🚀
dist/ro.8d5b380a.js 482.00b +0.00b 7.04s +1.75s ⚠️
dist/index.html 248.00b +0.00b 10.20s +4.90s ⚠️

Cached Bundles

Bundle Size Difference Time Difference
dist/media-viewer.38e3999a.js 536.13kb +0.00b 7.49s -2.85s 🚀
dist/component-lazy.51d1dec9.js 58.94kb +0.00b 4.69s -534.00ms 🚀
dist/ro.8d5b380a.js 482.00b +0.00b 5.25s -1.91s 🚀
dist/index.html 248.00b +0.00b 10.57s +5.33s ⚠️

Three.js ✅

Timings

Description Time Difference
Cold 2.85s +26.00ms
Cached 318.00ms +8.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 5d875a2 into v2 Oct 9, 2023
16 checks passed
@devongovett devongovett deleted the limit-workers branch October 9, 2023 23:27
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.

Heavy memory usage
3 participants