Skip to content

Regex impl (#2607)#2607

Open
Orvid wants to merge 1 commit intofacebook:mainfrom
Orvid:export-D97922157
Open

Regex impl (#2607)#2607
Orvid wants to merge 1 commit intofacebook:mainfrom
Orvid:export-D97922157

Conversation

@Orvid
Copy link
Copy Markdown
Contributor

@Orvid Orvid commented Apr 1, 2026

Summary:

Execution style chosen: All of them.

This uses a backtracking implementation by default, but, unless it can prove it isn't needed, will track the number of backtracks that occur and fall back to the NFA, or, if available, DFA executor if too many occur. This gets the perf benefits for the backtracking implementation by default in most cases, while also countering the worst-case-scenario.

For the benchmarks, Folly's implementation manages at least one, sometimes two, orders of magnitude improvement vs. the other regex implementations. The only implementations it currently falls behind in are a couple where RE2 wins, and a couple where CTRE wins. In cases where it's out-performed, it still manages to get very close to the performance of the other libraries :)

Work is still ongoing, the PR is only to see how the OSS tests behave.

Differential Revision: D97922157

@meta-cla meta-cla bot added the CLA Signed label Apr 1, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Apr 1, 2026

@Orvid has exported this pull request. If you are a Meta employee, you can view the originating Diff in D97922157.

Summary:

Execution style chosen: All of them. 

This uses a backtracking implementation by default, but, unless it can prove it isn't needed, will track the number of backtracks that occur and fall back to the NFA, or, if available, DFA executor if too many occur. This gets the perf benefits for the backtracking implementation by default in most cases, while also countering the worst-case-scenario.

For the benchmarks, Folly's implementation manages at least one, sometimes two, orders of magnitude improvement vs. the other regex implementations. The only implementations it currently falls behind in are a couple where RE2 wins, and a couple where CTRE wins. In cases where it's out-performed, it still manages to get very close to the performance of the other libraries :)

Work is still ongoing, the PR is only to see how the OSS tests behave.

Differential Revision: D97922157
@meta-codesync meta-codesync bot changed the title Regex impl Regex impl (#2607) Apr 1, 2026
@Orvid Orvid force-pushed the export-D97922157 branch from 9ae7958 to 3b75d28 Compare April 1, 2026 11:44
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.

1 participant