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

Optimize bundler performance #9266

Merged
merged 10 commits into from
Sep 30, 2023
Merged

Optimize bundler performance #9266

merged 10 commits into from
Sep 30, 2023

Conversation

devongovett
Copy link
Member

@devongovett devongovett commented Sep 24, 2023

This refactors the data structures in the default bundler and bundle graph to optimize for performance. This is the result of a lot of profiling, but the main optimizations are:

  • Store the reachableRoots data structure as an array of bit sets instead of a graph. For each asset, there is a bit set that stores which bundle roots are reachable, along with an inverse mapping. This enables much faster set operations without the cost of hashing, along with bulk operations like intersection. This uses 2 * numBundleRoots * numAssets / 8 bytes of space. For an extremely huge project that might be significant, but should still be in the 10s of megabytes.
  • A faster bit set implementation. The previous one used BigInt, which is not terribly well optimized by v8. The new one uses a fixed size Uint32Array defined at construction time, and a tiny wasm program exposing the count trailing zeros instruction to JS for iteration over the set bits.
  • Storing graph nodes as an array rather than a hash map, since the keys are numbers. This allows for faster lookups without hashing. Since node ids are never reused when a node is deleted, this also works, however, it will leave behind null values in the array. Not sure if this will be a problem.
  • A fast path depth-first search implementation for the common case of an enter visitor over all edge types. This avoids recursion, and is instead implemented using a stack. It also uses a faster method of iterating over child edges of a node that doesn't allocate memory to store the ids in an array, and a bit set to track the visited nodes. This avoids the abstraction cost of passing in a custom function to get the next node and filter by edge type. If these pre-conditions are not met, it will fall back to the previous slower implementation.

Benchmarks

From the React Spectrum docs:

Before:
Cold build: 60.31s
Rebuild (adding dependency): 22.32s

After:
Cold build: 39.42s
Rebuild (adding dependency): 2.98s

Those are full builds, including transforming and packaging. The bundling phase alone went from 21.19s to 1.49s, or almost 15x faster. 🚀

@parcel-benchmark
Copy link

parcel-benchmark commented Sep 24, 2023

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.85s +83.00ms
Cached 343.00ms +40.00ms ⚠️

Cold Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 335.00ms +35.00ms ⚠️
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 335.00ms +34.00ms ⚠️
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 336.00ms +35.00ms ⚠️
dist/legacy/index.b8ae99ba.css 94.00b +0.00b 345.00ms +34.00ms ⚠️
dist/modern/index.31cedca9.css 94.00b +0.00b 344.00ms +33.00ms ⚠️

Cached Bundles

No bundle changes detected.

React HackerNews ✅

Timings

Description Time Difference
Cold 4.98s +253.00ms ⚠️
Cached 474.00ms +14.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/PermalinkedComment.e9dc4a75.js 3.92kb +0.00b 391.00ms -58.00ms 🚀
dist/UserProfile.8945a243.js 1.38kb +0.00b 391.00ms -58.00ms 🚀
dist/NotFound.8b44a81d.js 269.00b +0.00b 391.00ms -58.00ms 🚀
dist/logo.8dd07848.png 244.00b +0.00b 272.00ms -68.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/logo.8dd07848.png 244.00b +0.00b 278.00ms -14.00ms 🚀

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 42.09s -1.06s
Cached 2.72s -111.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/index.84d72ff1.js 3.78mb +0.00b 19.84s -1.22s 🚀
dist/pdfRenderer.ba28cccc.js 1.11mb +0.00b 15.15s -1.24s 🚀
dist/editorView.a0126b37.js 619.22kb +0.00b 16.40s -1.06s 🚀
dist/refractor.3e0cc31b.js 598.96kb +0.00b 13.81s -897.00ms 🚀
dist/media-viewer.95ebe1bc.js 536.13kb +0.00b 13.81s -899.00ms 🚀
dist/popup.a77286c1.js 321.45kb +0.00b 13.81s -897.00ms 🚀
dist/EmojiPickerComponent.e0fdf479.js 188.61kb +0.00b 13.82s -891.00ms 🚀
dist/ConfigPanelFieldsLoader.0b2d3e5b.js 82.73kb +0.00b 13.82s -891.00ms 🚀
dist/mobile-upload.58bbf9ed.js 66.34kb +0.00b 6.02s -595.00ms 🚀
dist/esm.34897092.js 62.95kb +0.00b 13.82s -893.00ms 🚀
dist/archive.c374f622.js 59.90kb +0.00b 13.81s -917.00ms 🚀
dist/component-lazy.51d1dec9.js 58.94kb +0.00b 6.41s -607.00ms 🚀
dist/component.1c3fb78a.js 57.16kb +0.00b 6.02s -594.00ms 🚀
dist/DatePicker.042aeb21.js 47.46kb +0.00b 7.27s -500.00ms 🚀
dist/esm.4df8b361.js 39.11kb +0.00b 13.82s -893.00ms 🚀
dist/Modal.fb68d179.js 27.83kb +0.00b 6.02s -595.00ms 🚀
dist/DatePicker.ea34c6ed.js 24.96kb +0.00b 7.27s -500.00ms 🚀
dist/smartMediaEditor.efa59853.js 21.68kb +0.00b 13.82s -894.00ms 🚀
dist/esm.1c0d8031.js 20.43kb +0.00b 13.82s -894.00ms 🚀
dist/component.2c693853.js 18.68kb +0.00b 6.02s -596.00ms 🚀
dist/js.e1035d4d.js 17.15kb +0.00b 6.02s -595.00ms 🚀
dist/dropzone.e21a3321.js 13.40kb +0.00b 13.82s -892.00ms 🚀
dist/dropzone.1c15cdc1.js 11.48kb +0.00b 13.82s -892.00ms 🚀
dist/Toolbar.4d256e97.js 9.36kb +0.00b 13.82s -893.00ms 🚀
dist/clipboard.400013a2.js 7.92kb +0.00b 13.81s -897.00ms 🚀
dist/mobile-upload.3747b689.js 7.79kb +0.00b 6.02s -595.00ms 🚀
dist/mobile-upload.2102debb.js 7.79kb +0.00b 13.82s -894.00ms 🚀
dist/index.runtime.10b44ee9.js 7.29kb +0.00b 13.91s -949.00ms 🚀
dist/browser.0009c8b4.js 7.19kb +0.00b 13.82s -892.00ms 🚀
dist/index.b16227d6.css 4.08kb +0.00b 14.06s -831.00ms 🚀
dist/Modal.850345b4.js 3.86kb +0.00b 6.02s -595.00ms 🚀
dist/component.360dba95.js 3.20kb +0.00b 6.02s -595.00ms 🚀
dist/media-viewer-analytics-error-boundary.60bdaa4c.js 3.18kb +0.00b 13.81s -898.00ms 🚀
dist/media-picker-analytics-error-boundary.c493f011.js 3.18kb +0.00b 13.82s -892.00ms 🚀
dist/media-card-analytics-error-boundary.74e0c7f9.js 3.18kb +0.00b 13.81s -917.00ms 🚀
dist/png-chunks-extract.92497b2d.js 3.06kb +0.00b 6.02s -595.00ms 🚀
dist/ResourcedEmojiComponent.9a253c26.js 2.47kb +0.00b 7.27s -500.00ms 🚀
dist/pl.bce591be.js 2.25kb +0.00b 7.27s -500.00ms 🚀
dist/cs.bf42283b.js 2.23kb +0.00b 7.27s -501.00ms 🚀
dist/de.90d5c4fa.js 2.17kb +0.00b 7.27s -500.00ms 🚀
dist/fr.ff5d335f.js 2.13kb +0.00b 7.27s -501.00ms 🚀
dist/es.80bf0476.js 2.12kb +0.00b 7.27s -500.00ms 🚀
dist/hu.223c2cde.js 2.10kb +0.00b 7.27s -501.00ms 🚀
dist/fi.98bb8fa8.js 2.09kb +0.00b 7.27s -501.00ms 🚀
dist/ja.7d4156df.js 2.09kb +0.00b 7.27s -500.00ms 🚀
dist/pt_BR.b9e37d37.js 2.06kb +0.00b 7.27s -2.55s 🚀
dist/ko.9c6bf469.js 1.98kb +0.00b 7.27s -500.00ms 🚀
dist/it.04edb54a.js 1.97kb +0.00b 7.27s -501.00ms 🚀
dist/nb.9bd6db78.js 1.96kb +0.00b 7.27s -500.00ms 🚀
dist/date.139a08b0.js 1.95kb +0.00b 6.41s -607.00ms 🚀
dist/da.d2d8303e.js 1.95kb +0.00b 7.27s -500.00ms 🚀
dist/nl.c4d12122.js 1.94kb +0.00b 7.27s -500.00ms 🚀
dist/images.774ef3be.js 1.90kb +0.00b 6.41s -607.00ms 🚀
dist/feedback.4b745631.js 1.76kb +0.00b 7.27s -500.00ms 🚀
dist/status.20808f9b.js 1.67kb +0.00b 6.41s -608.00ms 🚀
dist/code.3ce450f8.js 1.56kb +0.00b 6.41s -606.00ms 🚀
dist/workerHasher.4f6584da.js 1.56kb +0.00b 6.02s -595.00ms 🚀
dist/workerHasher.730f3766.js 1.56kb +0.00b 13.82s -892.00ms 🚀
dist/workerHasher.9b1fcdbf.js 1.56kb +0.00b 13.82s -893.00ms 🚀
dist/workerHasher.02b63a21.js 1.56kb +0.00b 13.82s -893.00ms 🚀
dist/list-number.fdc97a50.js 1.47kb +0.00b 6.41s -607.00ms 🚀
dist/heading6.e6e03f52.js 1.36kb +0.00b 7.27s -500.00ms 🚀
dist/16.4998f52b.js 1.35kb +0.00b 6.02s -594.00ms 🚀
dist/heading3.73972e33.js 1.35kb +0.00b 6.41s -608.00ms 🚀
dist/16.330880f6.js 1.29kb +0.00b 6.02s -595.00ms 🚀
dist/link.71e06c5e.js 1.28kb +0.00b 6.41s -607.00ms 🚀
dist/emoji.8f9f45dc.js 1.25kb +0.00b 6.41s -607.00ms 🚀
dist/heading5.d2f94d9d.js 1.23kb +0.00b 7.27s -500.00ms 🚀
dist/expand.c983e90a.js 1.18kb +0.00b 7.27s -500.00ms 🚀
dist/heading2.c27d912d.js 1.17kb +0.00b 6.41s -607.00ms 🚀
dist/heading4.be08fc9e.js 1.12kb +0.00b 6.41s -607.00ms 🚀
dist/mention.f4723418.js 1.09kb +0.00b 6.41s -609.00ms 🚀
dist/layout.b5e3a7ef.js 1.05kb +0.00b 6.41s -607.00ms 🚀
dist/divider.7bb33712.js 1.04kb +0.00b 6.41s -607.00ms 🚀
dist/action.c407ac14.js 1.02kb +0.00b 6.41s -608.00ms 🚀
dist/heading1.d7caae19.js 1.02kb +0.00b 6.41s -607.00ms 🚀
dist/16.371e251f.js 1.00kb +0.00b 6.02s -595.00ms 🚀
dist/list.bd698aa0.js 1011.00b +0.00b 6.41s -608.00ms 🚀
dist/quote.d6bda47a.js 1011.00b +0.00b 6.41s -608.00ms 🚀
dist/decision.a17a0d00.js 992.00b +0.00b 6.41s -607.00ms 🚀
dist/16.8adad466.js 980.00b +0.00b 6.02s -596.00ms 🚀
dist/16.71432140.js 980.00b +0.00b 6.02s -596.00ms 🚀
dist/panel-warning.772e8569.js 968.00b +0.00b 6.41s -608.00ms 🚀
dist/16.e5f05248.js 960.00b +0.00b 6.02s -595.00ms 🚀
dist/16.549c63e3.js 955.00b +0.00b 6.41s -607.00ms 🚀
dist/table.e0e68580.js 946.00b +0.00b 6.41s -608.00ms 🚀
dist/16.79864de1.js 920.00b +0.00b 6.02s -595.00ms 🚀
dist/panel.45c00b08.js 887.00b +0.00b 6.41s -608.00ms 🚀
dist/panel-error.bfda44fb.js 864.00b +0.00b 6.41s -608.00ms 🚀
dist/16.7d7d7930.js 862.00b +0.00b 6.02s -595.00ms 🚀
dist/16.4556c00f.js 834.00b +0.00b 6.02s -595.00ms 🚀
dist/16.a44bb474.js 827.00b +0.00b 6.02s -595.00ms 🚀
dist/16.bf9fb66d.js 821.00b +0.00b 6.41s -607.00ms 🚀
dist/panel-success.4afcba7a.js 805.00b +0.00b 6.41s -608.00ms 🚀
dist/panel-note.58ef2b52.js 795.00b +0.00b 6.41s -608.00ms 🚀
dist/16.dffb58fe.js 782.00b +0.00b 6.02s -595.00ms 🚀
dist/16.0118b1f8.js 776.00b +0.00b 6.02s -596.00ms 🚀
dist/16.9a311f76.js 776.00b +0.00b 6.02s -596.00ms 🚀
dist/16.edf70d70.js 775.00b +0.00b 6.02s -596.00ms 🚀
dist/16.4af9f37f.js 774.00b +0.00b 6.02s -597.00ms 🚀
dist/16.aa70dcce.js 773.00b +0.00b 6.02s -595.00ms 🚀
dist/16.c715b7e1.js 746.00b +0.00b 6.41s -607.00ms 🚀
dist/16.54ffa2b2.js 725.00b +0.00b 6.02s -596.00ms 🚀
dist/16.d7c3881b.js 697.00b +0.00b 6.02s -595.00ms 🚀
dist/pt_PT.e211e609.js 635.00b +0.00b 7.27s -500.00ms 🚀
dist/et.88ef7cb4.js 633.00b +0.00b 7.27s -500.00ms 🚀
dist/simpleHasher.09765db3.js 589.00b +0.00b 6.02s -594.00ms 🚀
dist/simpleHasher.eefc98b4.js 589.00b +0.00b 13.82s -892.00ms 🚀
dist/simpleHasher.47b9c809.js 589.00b +0.00b 13.82s -893.00ms 🚀
dist/simpleHasher.cadc19c6.js 589.00b +0.00b 13.82s -894.00ms 🚀
dist/is.5f045a22.js 495.00b +0.00b 7.27s -501.00ms 🚀
dist/ro.8d5b380a.js 482.00b +0.00b 7.27s -2.55s 🚀
dist/en_GB.4c40e6c6.js 472.00b +0.00b 7.27s -500.00ms 🚀
dist/en.e1d21f6d.js 469.00b +0.00b 7.27s -500.00ms 🚀
dist/index.html 248.00b +0.00b 14.09s -840.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/refractor.3e0cc31b.js 598.96kb +0.00b 13.19s -701.00ms 🚀
dist/media-viewer.95ebe1bc.js 536.13kb +0.00b 13.20s -691.00ms 🚀
dist/popup.a77286c1.js 321.45kb +0.00b 13.19s -701.00ms 🚀
dist/ConfigPanelFieldsLoader.182d39bc.js 303.43kb +0.00b 9.52s -637.00ms 🚀
dist/EmojiPickerComponent.e0fdf479.js 188.61kb +0.00b 13.07s -829.00ms 🚀
dist/card.d06de810.js 138.91kb +0.00b 9.52s -629.00ms 🚀
dist/ConfigPanelFieldsLoader.0b2d3e5b.js 82.73kb +0.00b 13.07s -829.00ms 🚀
dist/mobile-upload.58bbf9ed.js 66.34kb +0.00b 6.04s -556.00ms 🚀
dist/esm.34897092.js 62.95kb +0.00b 13.19s -701.00ms 🚀
dist/ElementBrowser.e8f01080.js 61.94kb +0.00b 9.52s -631.00ms 🚀
dist/archive.c374f622.js 59.90kb +0.00b 13.20s -691.00ms 🚀
dist/esm.692cb9c1.js 59.30kb +0.00b 9.51s -644.00ms 🚀
dist/component-lazy.51d1dec9.js 58.94kb +0.00b 7.10s -592.00ms 🚀
dist/component.1c3fb78a.js 57.16kb +0.00b 6.04s -558.00ms 🚀
dist/DatePicker.042aeb21.js 47.46kb +0.00b 7.10s -588.00ms 🚀
dist/esm.4df8b361.js 39.11kb +0.00b 13.19s -700.00ms 🚀
dist/Modal.fb68d179.js 27.83kb +0.00b 6.04s -548.00ms 🚀
dist/DatePicker.ea34c6ed.js 24.96kb +0.00b 7.10s -589.00ms 🚀
dist/smartMediaEditor.efa59853.js 21.68kb +0.00b 13.20s -693.00ms 🚀
dist/esm.1c0d8031.js 20.43kb +0.00b 13.20s -694.00ms 🚀
dist/component.2c693853.js 18.68kb +0.00b 6.04s -547.00ms 🚀
dist/js.e1035d4d.js 17.15kb +0.00b 6.04s -544.00ms 🚀
dist/ConfigPanelFieldsLoader.5903e32b.js 15.74kb +0.00b 9.51s -637.00ms 🚀
dist/ui.8c117104.js 14.48kb +0.00b 9.51s -637.00ms 🚀
dist/ConfigPanelFieldsLoader.cade1f5a.js 13.63kb +0.00b 9.51s -637.00ms 🚀
dist/dropzone.e21a3321.js 13.40kb +0.00b 13.19s -701.00ms 🚀
dist/pdfRenderer.fa30a36a.js 12.04kb +0.00b 9.51s -636.00ms 🚀
dist/dropzone.1c15cdc1.js 11.48kb +0.00b 13.19s -701.00ms 🚀
dist/Toolbar.4d256e97.js 9.36kb +0.00b 13.20s -693.00ms 🚀
dist/clipboard.400013a2.js 7.92kb +0.00b 13.19s -701.00ms 🚀
dist/mobile-upload.3747b689.js 7.79kb +0.00b 6.04s -547.00ms 🚀
dist/mobile-upload.3baad8e4.js 7.79kb +0.00b 9.52s -636.00ms 🚀
dist/mobile-upload.7a892a37.js 7.79kb +0.00b 9.51s -645.00ms 🚀
dist/mobile-upload.2102debb.js 7.79kb +0.00b 13.20s -694.00ms 🚀
dist/index.runtime.10b44ee9.js 7.29kb +0.00b 13.20s -851.00ms 🚀
dist/browser.0009c8b4.js 7.19kb +0.00b 13.19s -701.00ms 🚀
dist/index.b16227d6.css 4.08kb +0.00b 13.23s -849.00ms 🚀
dist/Modal.850345b4.js 3.86kb +0.00b 6.04s -547.00ms 🚀
dist/component.360dba95.js 3.20kb +0.00b 6.04s -547.00ms 🚀
dist/media-viewer-analytics-error-boundary.60bdaa4c.js 3.18kb +0.00b 13.20s -691.00ms 🚀
dist/media-picker-analytics-error-boundary.c493f011.js 3.18kb +0.00b 13.19s -700.00ms 🚀
dist/media-card-analytics-error-boundary.74e0c7f9.js 3.18kb +0.00b 13.20s -693.00ms 🚀
dist/png-chunks-extract.92497b2d.js 3.06kb +0.00b 6.04s -542.00ms 🚀
dist/ru.0cf3f40e.js 2.81kb +0.00b 9.51s -637.00ms 🚀
dist/uk.282f23b1.js 2.76kb +0.00b 9.51s -636.00ms 🚀
dist/codeViewerRenderer.51140ec8.js 2.61kb +0.00b 13.20s -695.00ms 🚀
dist/th.137e1013.js 2.60kb +0.00b 9.51s -637.00ms 🚀
dist/ResourcedEmojiComponent.9a253c26.js 2.47kb +0.00b 7.10s -588.00ms 🚀
dist/pl.bce591be.js 2.25kb +0.00b 7.10s -588.00ms 🚀
dist/cs.bf42283b.js 2.23kb +0.00b 7.10s -589.00ms 🚀
dist/de.90d5c4fa.js 2.17kb +0.00b 7.10s -588.00ms 🚀
dist/fr.ff5d335f.js 2.13kb +0.00b 7.10s -589.00ms 🚀
dist/es.80bf0476.js 2.12kb +0.00b 7.10s -588.00ms 🚀
dist/hu.223c2cde.js 2.10kb +0.00b 7.10s -590.00ms 🚀
dist/fi.98bb8fa8.js 2.09kb +0.00b 7.10s -588.00ms 🚀
dist/ja.7d4156df.js 2.09kb +0.00b 7.10s -588.00ms 🚀
dist/vi.b46097db.js 2.09kb +0.00b 9.51s -636.00ms 🚀
dist/pt_BR.b9e37d37.js 2.06kb +0.00b 7.10s -588.00ms 🚀
dist/tr.c85d90a9.js 2.03kb +0.00b 9.51s -636.00ms 🚀
dist/ko.9c6bf469.js 1.98kb +0.00b 7.10s -588.00ms 🚀
dist/sv.1c06c95c.js 1.98kb +0.00b 9.51s -637.00ms 🚀
dist/it.04edb54a.js 1.97kb +0.00b 7.10s -589.00ms 🚀
dist/nb.9bd6db78.js 1.96kb +0.00b 7.10s -588.00ms 🚀
dist/date.139a08b0.js 1.95kb +0.00b 6.37s -480.00ms 🚀
dist/da.d2d8303e.js 1.95kb +0.00b 7.10s -588.00ms 🚀
dist/nl.c4d12122.js 1.94kb +0.00b 7.10s -588.00ms 🚀
dist/images.774ef3be.js 1.90kb +0.00b 6.37s -480.00ms 🚀
dist/zh_TW.b7c55aa6.js 1.86kb +0.00b 9.51s -636.00ms 🚀
dist/zh.b01fe721.js 1.84kb +0.00b 9.51s -636.00ms 🚀
dist/feedback.4b745631.js 1.76kb +0.00b 7.10s -588.00ms 🚀
dist/status.20808f9b.js 1.67kb +0.00b 6.37s -482.00ms 🚀
dist/code.3ce450f8.js 1.56kb +0.00b 6.36s -481.00ms 🚀
dist/workerHasher.4f6584da.js 1.56kb +0.00b 6.04s -544.00ms 🚀
dist/workerHasher.540c9790.js 1.56kb +0.00b 9.52s -631.00ms 🚀
dist/workerHasher.c840c607.js 1.56kb +0.00b 9.52s -637.00ms 🚀
dist/workerHasher.730f3766.js 1.56kb +0.00b 13.19s -701.00ms 🚀
dist/workerHasher.9b1fcdbf.js 1.56kb +0.00b 13.19s -700.00ms 🚀
dist/workerHasher.02b63a21.js 1.56kb +0.00b 13.20s -694.00ms 🚀
dist/list-number.fdc97a50.js 1.47kb +0.00b 6.37s -481.00ms 🚀
dist/heading6.e6e03f52.js 1.36kb +0.00b 7.10s -589.00ms 🚀
dist/16.4998f52b.js 1.35kb +0.00b 6.04s -558.00ms 🚀
dist/heading3.73972e33.js 1.35kb +0.00b 6.37s -482.00ms 🚀
dist/16.330880f6.js 1.29kb +0.00b 6.04s -548.00ms 🚀
dist/link.71e06c5e.js 1.28kb +0.00b 6.37s -481.00ms 🚀
dist/emoji.8f9f45dc.js 1.25kb +0.00b 6.37s -480.00ms 🚀
dist/heading5.d2f94d9d.js 1.23kb +0.00b 7.10s -589.00ms 🚀
dist/expand.c983e90a.js 1.18kb +0.00b 7.10s -588.00ms 🚀
dist/heading2.c27d912d.js 1.17kb +0.00b 6.37s -482.00ms 🚀
dist/heading4.be08fc9e.js 1.12kb +0.00b 6.37s -481.00ms 🚀
dist/mention.f4723418.js 1.09kb +0.00b 6.37s -481.00ms 🚀
dist/layout.b5e3a7ef.js 1.05kb +0.00b 6.37s -481.00ms 🚀
dist/divider.7bb33712.js 1.04kb +0.00b 6.37s -480.00ms 🚀
dist/action.c407ac14.js 1.02kb +0.00b 6.36s -481.00ms 🚀
dist/heading1.d7caae19.js 1.02kb +0.00b 6.37s -482.00ms 🚀
dist/16.371e251f.js 1.00kb +0.00b 6.04s -547.00ms 🚀
dist/list.bd698aa0.js 1011.00b +0.00b 6.37s -481.00ms 🚀
dist/quote.d6bda47a.js 1011.00b +0.00b 6.37s -481.00ms 🚀
dist/decision.a17a0d00.js 992.00b +0.00b 6.37s -480.00ms 🚀
dist/16.8adad466.js 980.00b +0.00b 6.04s -548.00ms 🚀
dist/16.71432140.js 980.00b +0.00b 6.04s -548.00ms 🚀
dist/panel-warning.772e8569.js 968.00b +0.00b 6.37s -480.00ms 🚀
dist/16.e5f05248.js 960.00b +0.00b 6.04s -548.00ms 🚀
dist/16.549c63e3.js 955.00b +0.00b 6.36s -480.00ms 🚀
dist/table.e0e68580.js 946.00b +0.00b 6.37s -482.00ms 🚀
dist/16.79864de1.js 920.00b +0.00b 6.04s -556.00ms 🚀
dist/panel.45c00b08.js 887.00b +0.00b 6.37s -481.00ms 🚀
dist/panel-error.bfda44fb.js 864.00b +0.00b 6.37s -480.00ms 🚀
dist/16.7d7d7930.js 862.00b +0.00b 6.04s -558.00ms 🚀
dist/16.4556c00f.js 834.00b +0.00b 6.04s -557.00ms 🚀
dist/16.a44bb474.js 827.00b +0.00b 6.04s -547.00ms 🚀
dist/16.bf9fb66d.js 821.00b +0.00b 6.36s -481.00ms 🚀
dist/panel-success.4afcba7a.js 805.00b +0.00b 6.37s -480.00ms 🚀
dist/panel-note.58ef2b52.js 795.00b +0.00b 6.37s -480.00ms 🚀
dist/16.dffb58fe.js 782.00b +0.00b 6.04s -558.00ms 🚀
dist/16.0118b1f8.js 776.00b +0.00b 6.04s -548.00ms 🚀
dist/16.9a311f76.js 776.00b +0.00b 6.04s -548.00ms 🚀
dist/16.edf70d70.js 775.00b +0.00b 6.04s -547.00ms 🚀
dist/16.4af9f37f.js 774.00b +0.00b 6.04s -547.00ms 🚀
dist/16.aa70dcce.js 773.00b +0.00b 6.04s -548.00ms 🚀
dist/16.c715b7e1.js 746.00b +0.00b 6.36s -481.00ms 🚀
dist/16.54ffa2b2.js 725.00b +0.00b 6.04s -547.00ms 🚀
dist/16.d7c3881b.js 697.00b +0.00b 6.04s -556.00ms 🚀
dist/sk.4be9c93f.js 656.00b +0.00b 9.51s -637.00ms 🚀
dist/pt_PT.e211e609.js 635.00b +0.00b 7.10s -588.00ms 🚀
dist/et.88ef7cb4.js 633.00b +0.00b 7.10s -588.00ms 🚀
dist/simpleHasher.09765db3.js 589.00b +0.00b 6.04s -544.00ms 🚀
dist/simpleHasher.c14e20b4.js 589.00b +0.00b 9.52s -636.00ms 🚀
dist/simpleHasher.23db7a52.js 589.00b +0.00b 9.51s -645.00ms 🚀
dist/simpleHasher.eefc98b4.js 589.00b +0.00b 13.19s -701.00ms 🚀
dist/simpleHasher.47b9c809.js 589.00b +0.00b 13.19s -700.00ms 🚀
dist/simpleHasher.cadc19c6.js 589.00b +0.00b 13.20s -694.00ms 🚀
dist/is.5f045a22.js 495.00b +0.00b 7.10s -590.00ms 🚀
dist/ro.8d5b380a.js 482.00b +0.00b 9.44s -713.00ms 🚀
dist/en_GB.4c40e6c6.js 472.00b +0.00b 7.10s -588.00ms 🚀
dist/en.e1d21f6d.js 469.00b +0.00b 7.10s -588.00ms 🚀
dist/index.html 248.00b +0.00b 13.26s -848.00ms 🚀

Three.js ✅

Timings

Description Time Difference
Cold 3.52s -98.00ms
Cached 380.00ms -3.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/Three.js 572.25kb +0.00b 1.13s -62.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/Three.js 572.25kb +0.00b 1.20s +97.00ms ⚠️

Click here to view a detailed benchmark overview.

@@ -20,6 +20,7 @@
"node": ">= 12.0.0"
},
"dependencies": {
"@parcel/utils": "^2.9.3",
Copy link
Member

Choose a reason for hiding this comment

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

We once had a PR that removed this dependency to get the graph package working in more environments: #8630

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe make the BitSet utils into a separate package?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm I had not considered that others would be using our graph package. I guess we would have to release this as a major then (changing the type of nodes)... 😕

I'd really like to avoid yet another package. We were just talking about consolidating them haha. Any other ideas?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I moved BitSet into the graph package, and made the default bundler use it from there instead of utils.

@devongovett devongovett merged commit 375a2e5 into v2 Sep 30, 2023
15 of 16 checks passed
@devongovett devongovett deleted the optimize-bundler branch September 30, 2023 23:18
Comment on lines +3 to +15
// Small wasm program that exposes the `ctz` instruction.
// https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/Numeric/Count_trailing_zeros
const wasmBuf = new Uint8Array([
0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x60, 0x01,
0x7f, 0x01, 0x7f, 0x03, 0x02, 0x01, 0x00, 0x07, 0x0d, 0x01, 0x09, 0x74, 0x72,
0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x30, 0x00, 0x00, 0x0a, 0x07, 0x01, 0x05,
0x00, 0x20, 0x00, 0x68, 0x0b, 0x00, 0x0f, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x02,
0x08, 0x01, 0x00, 0x01, 0x00, 0x03, 0x6e, 0x75, 0x6d,
]);

// eslint-disable-next-line
const {trailing0} = new WebAssembly.Instance(new WebAssembly.Module(wasmBuf))
.exports;
Copy link
Contributor

Choose a reason for hiding this comment

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

I like how you write Wasm in pure hex 😄

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.

5 participants