Skip to content

[10.x] Remove regex case insensitivity modifier in UUID detection to speed it up slightly - #50067

Merged
taylorotwell merged 1 commit into
laravel:10.xfrom
maximal:uuid-sensitive-regex
Feb 13, 2024
Merged

taylorotwell merged 1 commit into
laravel:10.xfrom
maximal:uuid-sensitive-regex

Conversation

@maximal

@maximal maximal commented Feb 13, 2024

Copy link
Copy Markdown
Contributor

Generally speaking, in any platform, case insensitive regex matching is slower than the sensitive one:

I’d suggest to turn the case insensitivity flag off in UUID matching and enumerate [a-fA-F] characters explicitly.

The speed up (measured in a billion iterations) is about 5 % when the match is successful and about 5-10 % with the unsuccessful one.

@taylorotwell
taylorotwell merged commit d3533e1 into laravel:10.x Feb 13, 2024
@maximal
maximal deleted the uuid-sensitive-regex branch February 13, 2024 14:49
@GrahamCampbell GrahamCampbell changed the title Remove regex case insensitivity modifier in UUID detection to speed it up slightly [10.x] Remove regex case insensitivity modifier in UUID detection to speed it up slightly Feb 13, 2024
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.

2 participants