Skip to content

Share the same processor in firstMatch #497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

milseman
Copy link
Member

@milseman milseman commented Jun 17, 2022

Gives a 7x improvement to firstMatch-style benchmarks like "FirstMatch", 2-3x to CSS and basic backtracking benchmarks.

Based on @rctcwyvrn 's original code at #489

- ReluctantQuant 117ms
- ReluctantQuantWithTerminal 75.6ms
- EagarQuantWithTerminal 68ms
- BasicBacktrack 9.24ms
- BasicBacktrackFirstMatch 9.3ms
- cssRegex 44.1ms
- FirstMatch 80.1ms
- AllMatches 36ms

After

- ReluctantQuant 113ms
- ReluctantQuantWithTerminal 73.1ms
- EagarQuantWithTerminal 70.7ms
- BasicBacktrack 4.15ms
- BasicBacktrackFirstMatch 3.92ms
- cssRegex 15.7ms
- FirstMatch 11.8ms
- AllMatches 33.3ms

@milseman milseman requested a review from natecook1000 June 17, 2022 21:08
Gives a 7x improvement to firstMatch-style benchmarks like "FirstMatch", 2-3x to CSS and basic backtracking benchmarks.

Thanks to @rctcwyvrn for the original code.
@milseman milseman force-pushed the firstest_with_the_matchiest branch from d77b291 to 0b04028 Compare June 17, 2022 21:14
@milseman
Copy link
Member Author

@swift-ci please test

@milseman milseman merged commit fcd0b59 into swiftlang:main Jun 17, 2022
@milseman milseman deleted the firstest_with_the_matchiest branch June 17, 2022 21:30
milseman added a commit to natecook1000/swift-experimental-string-processing that referenced this pull request Jun 17, 2022
Gives a 7x improvement to firstMatch-style benchmarks like "FirstMatch", 2-3x to CSS and basic backtracking benchmarks.

Thanks to @rctcwyvrn for the original code.
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