-
Notifications
You must be signed in to change notification settings - Fork 275
Performance and general clean up #312
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
Conversation
|
LGTM 👍 |
|
|
If there is whitespace in a regex, is there a rule that it must be "escaped" with a backslash? I vaguely remember this is due to people using the raw export not because of PHP. For example this line and the next differ. Crawler-Detect/src/Fixtures/Crawlers.php Line 557 in 0935d1e
Crawler-Detect/src/Fixtures/Crawlers.php Line 558 in 0935d1e
|
|
44 regexs removed. A lot of tidying up as well. All listed below.
|
|
Seen roughly a 4 - 6% increase in speed. It will easily be eaten up as we add more user agents, but a good clean out none the less. |
Performance and general clean up (JayBizzle/Crawler-Detect#312)
I haven't done any comparisons yet. But removing regexes and shortening others can only help right!
So far I have:
checkerto the generic regex which removes the need for 13 other regexes.readerto the generic regex which removes the need for 10 other regexes.I've made sure that every regex removed had a related user agent in the tests.
I am going to shorten a lot of the really long regexes as they just don't need to be so long.
What are peoples thoughts on adding the word
extractorto the generic regex? This would eliminate the need for another 6 regexes which I feel are so specific to bots.