Skip to content
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

perf(pattern): improve general perf #1300

Merged
merged 2 commits into from
Aug 4, 2020
Merged

perf(pattern): improve general perf #1300

merged 2 commits into from
Aug 4, 2020

Conversation

P0lip
Copy link
Contributor

@P0lip P0lip commented Aug 3, 2020

Leverages the cache mechanism we added back in 5.4 so that each regular expression does not to be compiled each time.
Moreover, we avoid an allocation of an array if not required.
It's not like the perf gain is huge, but it's like 2-4% on average, which is still something.

Oh, and I expose cache to built-in (core) functions, because they didn't have access to it beforehand.

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

@P0lip P0lip added the chore label Aug 3, 2020
@P0lip P0lip self-assigned this Aug 3, 2020
@P0lip P0lip requested review from marbemac and philsturgeon August 4, 2020 09:27
@P0lip P0lip merged commit c9d2714 into develop Aug 4, 2020
@P0lip P0lip deleted the perf/pattern-fn branch August 4, 2020 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants