Skip to content

perf: pre-compile middleware matcher regexes#92943

Open
iruizsalinas wants to merge 1 commit intovercel:canaryfrom
iruizsalinas:perf/precompile-middleware-matcher
Open

perf: pre-compile middleware matcher regexes#92943
iruizsalinas wants to merge 1 commit intovercel:canaryfrom
iruizsalinas:perf/precompile-middleware-matcher

Conversation

@iruizsalinas
Copy link
Copy Markdown

getMiddlewareRouteMatcher currently rebuilds a RegExp from matcher.regexp on every request, even though the source string doesn't change for the life of the matcher. This moves the compile out of the returned closure so each matcher's regex is built once and reused.

@nextjs-bot
Copy link
Copy Markdown
Contributor

Allow CI Workflow Run

  • approve CI run for commit: a9d4c69

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

1 similar comment
@nextjs-bot
Copy link
Copy Markdown
Contributor

Allow CI Workflow Run

  • approve CI run for commit: a9d4c69

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants