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

use minimal RegExp matching for more performance #977

Merged
merged 1 commit into from
Sep 5, 2018
Merged

use minimal RegExp matching for more performance #977

merged 1 commit into from
Sep 5, 2018

Conversation

xixilive
Copy link
Contributor

@xixilive xixilive commented Sep 4, 2018

Summary

A minimal matching is very faster than a wildcard matching in RegExp object, specially for long string case.

A test case gist at: https://gist.github.com/xixilive/99f4dc4dc175ca0386cb6e34d5f24ac1

this test case output on my machine:

Strip with wildcard matching
Time of strip1:: 540.535ms
Strip with minimal matching
Time of strip2:: 272.998ms

Closes #976

@daffl daffl merged commit 3ca7e97 into feathersjs:master Sep 5, 2018
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.

2 participants