Title: perf: rspack and webpack adapters rebuild hook filters on every call · Issue #620 · unjs/unplugin · GitHub
Open Graph Title: perf: rspack and webpack adapters rebuild hook filters on every call · Issue #620 · unjs/unplugin
X Title: perf: rspack and webpack adapters rebuild hook filters on every call · Issue #620 · unjs/unplugin
Description: Describe the feature In the rspack and webpack adapters, a plugin's include/exclude filters are rebuilt every time they are checked: for every module against each transform rule, on each transform loader call and on each resolveId call. ...
Open Graph Description: Describe the feature In the rspack and webpack adapters, a plugin's include/exclude filters are rebuilt every time they are checked: for every module against each transform rule, on each transform ...
X Description: Describe the feature In the rspack and webpack adapters, a plugin's include/exclude filters are rebuilt every time they are checked: for every module against each transform rule, on each transf...
Opengraph URL: https://github.com/unjs/unplugin/issues/620
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"perf: rspack and webpack adapters rebuild hook filters on every call","articleBody":"### Describe the feature\n\nIn the rspack and webpack adapters, a plugin's `include`/`exclude` filters are rebuilt every time they are checked: for every module against each transform rule, on each transform loader call and on each `resolveId` call. String patterns are compiled with picomatch each time. The rollup, vite, rolldown and bun adapters build their filters once.\n\nOn a generated Rspack project with 60,001 modules and one transform hook, building each filter once makes cold builds 29 to 33% faster and warm builds (persistent cache) 24 to 32% faster, with identical output. Benchmark: https://github.com/guru-irl/rspack/tree/bench/unplugin-filter-u2/bench/unplugin-filter\n\nProposal: build each filter on first use and reuse it until the plugin's hook is replaced or `process.cwd()` changes. I have a PR ready.\n\n### Additional information\n\n- [x] Would you be willing to help implement this feature?\n","author":{"url":"https://github.com/guru-irl","@type":"Person","name":"guru-irl"},"datePublished":"2026-10-12T05:24:53Z","url":"https://github.com/unjs/unplugin/issues/620"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:966048f0-8c0c-ad87-2b7a-b63457128cba |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8C9C:28117B:17CF39:21AEE2:6B00664B |
| html-safe-nonce | 2efb3ad777bbace63080c4f709cc107f532e90f9119cbff6738b6d9c0edfdbdf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzlDOjI4MTE3QjoxN0NGMzk6MjFBRUUyOjZCMDA2NjRCIiwidmlzaXRvcl9pZCI6IjgwODczNTg2NjA2NDYyOTkyMTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7592566470f207618db4a5241d13924b43c1394cf37e82c3ce46e3607788bbe4 |
| hovercard-subject-tag | issue:5808805866 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/unjs/unplugin/620/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eefae8f0e3f2e36d4b08e4e83ef78ef6f01e7ef7f5157be83c47258513e2f874/unjs/unplugin/issues/620 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eefae8f0e3f2e36d4b08e4e83ef78ef6f01e7ef7f5157be83c47258513e2f874/unjs/unplugin/issues/620 |
| og:image:alt | Describe the feature In the rspack and webpack adapters, a plugin's include/exclude filters are rebuilt every time they are checked: for every module against each transform rule, on each transform ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | guru-irl |
| hostname | github.com |
| expected-hostname | github.com |
| None | 25854482a1773a7c1ebb8be3d2bc1c6e61d82d78126be63b5044474a86d44d9e |
| turbo-cache-control | no-preview |
| go-import | github.com/unjs/unplugin git https://github.com/unjs/unplugin.git |
| octolytics-dimension-user_id | 80154025 |
| octolytics-dimension-user_login | unjs |
| octolytics-dimension-repository_id | 385261169 |
| octolytics-dimension-repository_nwo | unjs/unplugin |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 385261169 |
| octolytics-dimension-repository_network_root_nwo | unjs/unplugin |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e4f5c239e31f1f680e6bbc419ff92d774da616ec |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width