Skip to content

Micro-optimization: Move compilation of some Regex generation to compile time instead of runtime, make some static ones compiled#20287

Merged
AndyButland merged 1 commit intoumbraco:mainfrom
Henr1k80:correctness
Sep 28, 2025
Merged

Micro-optimization: Move compilation of some Regex generation to compile time instead of runtime, make some static ones compiled#20287
AndyButland merged 1 commit intoumbraco:mainfrom
Henr1k80:correctness

Conversation

@Henr1k80
Copy link
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

Description

This is not in any hot code path, this is just a little prep to possibly have all Regex generated at compile time instead of at runtime.
If all runtime regex generation is removed, the regex generation code is never needed at runtime, only at compile time.
This results in faster startup, as less IL ASM needs to be compiled

@github-actions
Copy link

Hi there @Henr1k80, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

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

All looks fine to me, thanks for the contribution @Henr1k80.

@AndyButland AndyButland changed the title Move compilation of some Regex generation to compile time instead of runtime, make some static ones compiled Micro-optimization: Move compilation of some Regex generation to compile time instead of runtime, make some static ones compiled Sep 28, 2025
@AndyButland AndyButland merged commit fbbbc45 into umbraco:main Sep 28, 2025
26 checks passed
@Henr1k80 Henr1k80 deleted the correctness branch September 29, 2025 09:57
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