Skip to content

Conversation

natecook1000
Copy link
Member

Adds a new subcommand to the RegexTester executable that demonstrates the difference between using regex patterns in different locations:

  • statically created
  • local to a function, but outside a loop
  • local to a function, inside a loop

The compiler currently does not hoist the regex out of the loop, so it pays the parse/compile cost during every iteration.

Adds a new subcommand to the RegexTester executable that demonstrates
the difference between using regex patterns in different locations:
- statically created
- local to a function, but outside a loop
- local to a function, inside a loop

The compiler currently does not hoist the regex out of the loop, so
it pays the parse/compile cost during every iteration.
@natecook1000 natecook1000 force-pushed the loop-inner-regex-example branch from c0d9a48 to c05e499 Compare October 16, 2025 16:08
@natecook1000
Copy link
Member Author

@swift-ci Please test Linux platform

@natecook1000 natecook1000 merged commit efe8986 into main Oct 16, 2025
21 checks passed
@natecook1000 natecook1000 deleted the loop-inner-regex-example branch October 16, 2025 19:29
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.

1 participant