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: regex new is expensive #2982

Merged
merged 1 commit into from
Aug 26, 2021

Conversation

driftluo
Copy link
Collaborator

What problem does this PR solve?

regex new is expensive,reinitialization every time enter the function is not a good strategy

What is changed and how it works?

use once_cell to wrapper regex

Release note

Title Only: Include only the PR title in the release note.

@driftluo driftluo requested a review from a team as a code owner August 26, 2021 06:49
@driftluo driftluo requested review from quake and liya2017 August 26, 2021 06:49
@driftluo driftluo added the s:waiting-on-reviewers Status: Waiting for Review label Aug 26, 2021
@yangby-cryptape yangby-cryptape removed the s:waiting-on-reviewers Status: Waiting for Review label Aug 26, 2021
@driftluo
Copy link
Collaborator Author

bors r=yangby-cryptape,zhangsoledad

bors bot added a commit that referenced this pull request Aug 26, 2021
2982: perf: regex new is expensive r=yangby-cryptape,zhangsoledad a=driftluo

### What problem does this PR solve?

regex new is expensive,reinitialization every time enter the function is not a good strategy 

### What is changed and how it works?

use once_cell to wrapper regex

### Release note

```release-note
Title Only: Include only the PR title in the release note.
```



Co-authored-by: driftluo <[email protected]>
@bors
Copy link
Contributor

bors bot commented Aug 26, 2021

Build failed:

@driftluo
Copy link
Collaborator Author

bors r=yangby-cryptape,zhangsoledad

@bors
Copy link
Contributor

bors bot commented Aug 26, 2021

Build succeeded:

@bors bors bot merged commit 805ed1e into nervosnetwork:develop Aug 26, 2021
@driftluo driftluo deleted the perf-regex-with-once-cell branch August 26, 2021 13:23
@doitian doitian mentioned this pull request Sep 3, 2021
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.

3 participants