Skip to content

More optimizations, remove history preservation #495

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 3 commits into from
Jun 17, 2022

Conversation

milseman
Copy link
Member

Implement some more of the identified optimizations:

- ReluctantQuant 176ms
- ReluctantQuantWithTerminal 231ms
- EagarQuantWithTerminal 69.1ms
- BasicBacktrack 20.5ms
- BasicBacktrackFirstMatch 19.9ms
- cssRegex 93.6ms
- FirstMatch 140ms
- AllMatches 37.1ms

After

- ReluctantQuant 117ms
- ReluctantQuantWithTerminal 75ms
- EagarQuantWithTerminal 68.3ms
- BasicBacktrack 10ms
- BasicBacktrackFirstMatch 10.1ms
- cssRegex 41.4ms
- FirstMatch 76.8ms
- AllMatches 38ms

milseman added 3 commits June 17, 2022 12:37
Gives around a 20% perf improvement to first-match style benchmarks.
Cuts down on memory usage and avoids some ARC overhead. ~20% gains
on "AllMatches" and related benchmarks.
Avoid collection algorithms inside matchSeq, which are liable to add ARC and inefficiencies. Results in a 3x improvement to ReluctantQuantWithTerminal.
@milseman
Copy link
Member Author

@swift-ci please test

@milseman milseman requested a review from natecook1000 June 17, 2022 18:42
@milseman
Copy link
Member Author

Merging to unblock some more perf work

@milseman milseman merged commit 1356e8c into swiftlang:main Jun 17, 2022
@milseman milseman deleted the end_of_history branch June 17, 2022 19:03
milseman added a commit to natecook1000/swift-experimental-string-processing that referenced this pull request Jun 17, 2022
* Re-use the same executor, remember semantic mode.

Gives around a 20% perf improvement to first-match style benchmarks.

* Remove history preservation

Cuts down on memory usage and avoids some ARC overhead. ~20% gains
on "AllMatches" and related benchmarks.

* Lower-level matchSeq

Avoid collection algorithms inside matchSeq, which are liable to add ARC and inefficiencies. Results in a 3x improvement to ReluctantQuantWithTerminal.
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