-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Increase the performance (x6) #474
Comments
Great! |
Hi,what's up,why not a push to master? Any1 else just did not feel the cold of slowing down.... |
I like the idea, I cannot add it to the current iteration ( |
Class to increase the performance of Mobile Detect lib.
Mobile Detect uses a loop with regular expressions to determine the device, and PHP is very slow on this. By reducing the size of the string in the regular expression we get increased performance.
The information theory says that the most frequent words provide less information. Then if it appears in 100% of cases the word "Mozilla" can exclude it from the regular expression as it will be irrelevant in determining the device in the User Agent.
What we do is create an array ($irrelevant) with the list of "irrelevant words" to exclude of User Agent.
Source: https://bitbucket.org/lanaguani/mobile-detect-fast/
The text was updated successfully, but these errors were encountered: