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 Webpack loader detection regex dramatically faster #7226

Merged
merged 2 commits into from
Nov 2, 2021

Conversation

mischnic
Copy link
Member

@mischnic mischnic commented Nov 1, 2021

That regex took way too long on an 2mb input string. The new one should be equivalent (and take <1ms on 2mb)

Closes #6760

@height
Copy link

height bot commented Nov 1, 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 Nov 1, 2021

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.85s -22.00ms
Cached 292.00ms -9.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 537.00ms -43.00ms 🚀
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 538.00ms -43.00ms 🚀
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 537.00ms -44.00ms 🚀

Cached Bundles

No bundle changes detected.

React HackerNews ✅

Timings

Description Time Difference
Cold 9.88s -31.00ms
Cached 447.00ms -15.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/index.js 487.00kb +0.00b 5.02s -303.00ms 🚀
dist/PermalinkedComment.62775cc6.js 4.20kb +0.00b 5.02s -302.00ms 🚀
dist/UserProfile.1b7befb5.js 1.57kb +0.00b 5.02s -303.00ms 🚀
dist/NotFound.e6c89571.js 429.00b +0.00b 5.02s -303.00ms 🚀
dist/logo.c5bb83f1.png 246.00b +0.00b 4.98s -301.00ms 🚀

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.01m +972.00ms
Cached 1.64s +11.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/EmojiPickerComponent.2bc79859.js 146.67kb +0.00b 18.71s -8.85s 🚀
dist/esm.f1a592e5.js 33.15kb +0.00b 18.71s -8.85s 🚀
dist/DatePicker.f2994e45.js 22.98kb +0.00b 18.71s -8.85s 🚀
dist/js.660b75db.js 17.25kb +0.00b 34.30s -10.12s 🚀
dist/png-chunks-extract.5c9c0fb9.js 3.58kb +0.00b 34.30s -10.12s 🚀
dist/images.14c73fbf.js 1.81kb +0.00b 18.71s +943.00ms ⚠️
dist/feedback.c7e69064.js 1.77kb +0.00b 18.71s -8.85s 🚀
dist/workerHasher.3639b1f9.js 1.63kb +0.00b 18.71s -8.85s 🚀
dist/list-number.8ff56815.js 1.59kb +0.00b 18.71s +943.00ms ⚠️
dist/status.b77f2884.js 1.59kb +0.00b 18.71s +942.00ms ⚠️
dist/heading6.a693146e.js 1.51kb +0.00b 18.71s -8.85s 🚀
dist/heading3.c47f2a80.js 1.50kb +0.00b 18.71s +943.00ms ⚠️
dist/link.e01a03a1.js 1.43kb +0.00b 18.71s +943.00ms ⚠️
dist/heading5.8bfafe21.js 1.38kb +0.00b 18.71s -8.85s 🚀
dist/emoji.0f0d45df.js 1.36kb +0.00b 18.71s +943.00ms ⚠️
dist/heading2.d4e27733.js 1.32kb +0.00b 18.71s +942.00ms ⚠️
dist/expand.a44d10fe.js 1.29kb +0.00b 18.71s -8.85s 🚀
dist/heading4.094fd60f.js 1.27kb +0.00b 18.71s +943.00ms ⚠️
dist/mention.2459dc08.js 1.20kb +0.00b 18.71s +944.00ms ⚠️
dist/layout.b4aa6b3e.js 1.18kb +0.00b 18.71s +943.00ms ⚠️
dist/heading1.b05a7fc7.js 1.16kb +0.00b 18.71s +942.00ms ⚠️
dist/divider.14c72acd.js 1.16kb +0.00b 18.71s +944.00ms ⚠️
dist/quote.153c231a.js 1.15kb +0.00b 18.71s +942.00ms ⚠️
dist/decision.fe885d3c.js 1.12kb +0.00b 18.71s +944.00ms ⚠️
dist/panel-warning.ee7c59bf.js 1.12kb +0.00b 18.71s +944.00ms ⚠️
dist/list.590bc73a.js 1.09kb +0.00b 18.71s +943.00ms ⚠️
dist/panel-error.3f2f0480.js 1.02kb +0.00b 18.71s +944.00ms ⚠️
dist/panel.cd7fe8d3.js 1.01kb +0.00b 18.71s +942.00ms ⚠️
dist/table.209f2bb0.js 1024.00b +0.00b 18.71s +942.00ms ⚠️
dist/panel-success.2bcdfb70.js 980.00b +0.00b 18.71s +944.00ms ⚠️
dist/panel-note.55838b19.js 976.00b +0.00b 18.71s +944.00ms ⚠️

Cached Bundles

Bundle Size Difference Time Difference
dist/index.515b48d1.js 1.78mb +0.00b 18.92s +1.20s ⚠️
dist/EmojiPickerComponent.2bc79859.js 146.67kb +0.00b 34.61s +5.20s ⚠️
dist/component.5b4e4410.js 37.35kb +0.00b 18.92s +1.20s ⚠️
dist/esm.f1a592e5.js 33.15kb +0.00b 34.61s +5.20s ⚠️
dist/component.741edbc5.js 24.94kb +0.00b 18.91s +1.20s ⚠️
dist/DatePicker.f2994e45.js 22.98kb +0.00b 34.61s +5.20s ⚠️
dist/component.598bf511.js 6.83kb +0.00b 18.69s +1.18s ⚠️
dist/media-viewer.a19e03bf.js 4.50kb +0.00b 48.96s +13.65s ⚠️
dist/media-viewer.21624a99.js 3.93kb +0.00b 48.96s +13.65s ⚠️
dist/16.4e6ce5ae.js 2.35kb +0.00b 18.92s +1.20s ⚠️
dist/card.47672f0e.js 2.04kb +0.00b 48.96s +13.65s ⚠️
dist/date.ada90b9d.js 1.87kb +0.00b 18.91s +1.20s ⚠️
dist/images.14c73fbf.js 1.81kb +0.00b 20.60s +1.43s ⚠️
dist/feedback.c7e69064.js 1.77kb +0.00b 34.61s +5.20s ⚠️
dist/16.f9bcc218.js 1.74kb +0.00b 18.69s +1.18s ⚠️
dist/16.8cacdd41.js 1.67kb +0.00b 18.69s +1.18s ⚠️
dist/workerHasher.3639b1f9.js 1.63kb +0.00b 34.61s +5.20s ⚠️
dist/list-number.8ff56815.js 1.59kb +0.00b 20.60s +1.43s ⚠️
dist/status.b77f2884.js 1.59kb +0.00b 20.60s +1.43s ⚠️
dist/code.00826c30.js 1.51kb +0.00b 18.91s +1.20s ⚠️
dist/heading6.a693146e.js 1.51kb +0.00b 34.61s +5.20s ⚠️
dist/heading3.c47f2a80.js 1.50kb +0.00b 20.61s +1.43s ⚠️
dist/link.e01a03a1.js 1.43kb +0.00b 20.60s +1.43s ⚠️
dist/16.3ea64ad5.js 1.39kb +0.00b 18.69s +1.18s ⚠️
dist/heading5.8bfafe21.js 1.38kb +0.00b 34.61s +5.20s ⚠️
dist/emoji.0f0d45df.js 1.36kb +0.00b 20.60s +1.43s ⚠️
dist/16.dde66fb5.js 1.34kb +0.00b 18.69s +1.18s ⚠️
dist/16.17fccf53.js 1.34kb +0.00b 18.69s +1.18s ⚠️
dist/16.e572fbc0.js 1.32kb +0.00b 18.69s +1.18s ⚠️
dist/heading2.d4e27733.js 1.32kb +0.00b 20.61s +1.43s ⚠️
dist/16.82436cab.js 1.32kb +0.00b 18.69s +1.18s ⚠️
dist/expand.a44d10fe.js 1.29kb +0.00b 34.61s +5.20s ⚠️
dist/16.bbe3d65c.js 1.28kb +0.00b 18.69s +1.18s ⚠️
dist/heading4.094fd60f.js 1.27kb +0.00b 20.61s +1.43s ⚠️
dist/16.da4ba1b5.js 1.24kb +0.00b 18.69s +1.18s ⚠️
dist/16.5076785a.js 1.21kb +0.00b 18.69s +1.18s ⚠️
dist/16.b2ed99cf.js 1.20kb +0.00b 18.69s +1.18s ⚠️
dist/mention.2459dc08.js 1.20kb +0.00b 20.60s +1.43s ⚠️
dist/16.7d56994f.js 1.19kb +0.00b 18.69s +1.18s ⚠️
dist/layout.b4aa6b3e.js 1.18kb +0.00b 20.60s +1.43s ⚠️
dist/Modal.ca6d4d94.js 1.16kb +0.00b 48.97s +13.66s ⚠️
dist/heading1.b05a7fc7.js 1.16kb +0.00b 20.61s +1.43s ⚠️
dist/divider.14c72acd.js 1.16kb +0.00b 20.60s +1.43s ⚠️
dist/quote.153c231a.js 1.15kb +0.00b 20.60s +1.43s ⚠️
dist/16.4788b572.js 1.15kb +0.00b 18.69s +1.18s ⚠️
dist/16.f98e3014.js 1.15kb +0.00b 18.69s +1.18s ⚠️
dist/16.10f72c3a.js 1.14kb +0.00b 18.69s +1.18s ⚠️
dist/16.d0a606ba.js 1.14kb +0.00b 18.69s +1.18s ⚠️
dist/16.75f3718c.js 1.14kb +0.00b 18.69s +1.18s ⚠️
dist/action.0ca21388.js 1.14kb +0.00b 18.91s +1.20s ⚠️
dist/16.a1253273.js 1.14kb +0.00b 18.69s +1.18s ⚠️
dist/component.6377d10b.js 1.13kb +0.00b 18.92s +1.21s ⚠️
dist/decision.fe885d3c.js 1.12kb +0.00b 20.60s +1.43s ⚠️
dist/panel-warning.ee7c59bf.js 1.12kb +0.00b 20.60s +1.43s ⚠️
dist/16.70992eab.js 1.10kb +0.00b 18.69s +1.18s ⚠️
dist/list.590bc73a.js 1.09kb +0.00b 20.60s +1.43s ⚠️
dist/16.dbb3595d.js 1.06kb +0.00b 18.69s +1.18s ⚠️
dist/panel-error.3f2f0480.js 1.02kb +0.00b 20.60s +1.43s ⚠️
dist/panel.cd7fe8d3.js 1.01kb +0.00b 20.60s +1.43s ⚠️
dist/table.209f2bb0.js 1024.00b +0.00b 20.61s +1.43s ⚠️
dist/panel-success.2bcdfb70.js 980.00b +0.00b 20.60s +1.43s ⚠️
dist/panel-note.55838b19.js 976.00b +0.00b 20.60s +1.43s ⚠️
dist/index.html 386.00b +0.00b 20.40s -27.47s 🚀

Three.js ✅

Timings

Description Time Difference
Cold 6.83s +108.00ms
Cached 328.00ms -49.00ms 🚀

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/Three.js 579.68kb +0.00b 4.74s -382.00ms 🚀

Click here to view a detailed benchmark overview.

@devongovett devongovett merged commit 1d32c80 into v2 Nov 2, 2021
@devongovett devongovett deleted the 6760-regex-slow branch November 2, 2021 16:24
lettertwo added a commit that referenced this pull request Nov 15, 2021
* v2: (68 commits)
  Fix RangeError in `not export` error with other file type (#7295)
  Apply sourcemap in @parcel/transformer-typescript-tsc (#7287)
  Fix side effects glob matching (#7288)
  Fix changelog headings
  v2.0.1
  Changelog for v2.0.1
  Resolve GLSL relative to the importer, not the asset (#7263)
  fix: add @parcel/diagnostic as dependency of @parcel/transformer-typescript-types (#7248)
  Fixed missing "Parcel" export member in Module "@parcel/core" (#7250)
  Add script to sync engines with core version (#7207)
  Bump swc (#7216)
  Make Webpack loader detection regex dramatically faster (#7226)
  swc optimizer (#7212)
  Update esbuild in optimizer (#7233)
  Properly visit member expressions (#7228)
  Update to prettier 2 (#7209)
  Fix serve mode with target override and target source fields (#7187)
  Update package.json to include the repository (#7184)
  fix #6730: add transformer-raw as dependency of config-webextension (#7193)
  Log warning instead of crash if image optimizer fails (#7119)
  ...
lettertwo added a commit that referenced this pull request Nov 15, 2021
* v2: (68 commits)
  Fix RangeError in `not export` error with other file type (#7295)
  Apply sourcemap in @parcel/transformer-typescript-tsc (#7287)
  Fix side effects glob matching (#7288)
  Fix changelog headings
  v2.0.1
  Changelog for v2.0.1
  Resolve GLSL relative to the importer, not the asset (#7263)
  fix: add @parcel/diagnostic as dependency of @parcel/transformer-typescript-types (#7248)
  Fixed missing "Parcel" export member in Module "@parcel/core" (#7250)
  Add script to sync engines with core version (#7207)
  Bump swc (#7216)
  Make Webpack loader detection regex dramatically faster (#7226)
  swc optimizer (#7212)
  Update esbuild in optimizer (#7233)
  Properly visit member expressions (#7228)
  Update to prettier 2 (#7209)
  Fix serve mode with target override and target source fields (#7187)
  Update package.json to include the repository (#7184)
  fix #6730: add transformer-raw as dependency of config-webextension (#7193)
  Log warning instead of crash if image optimizer fails (#7119)
  ...
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.

parcel hangs on build on random file
3 participants