filosganga / scala-wurfl

WURFL Scala API
Apache License 2.0
5 stars 0 forks source link

Very slow detection time for some user agents #5

Open billthornton opened 10 years ago

billthornton commented 10 years ago

Firstly, thanks for this project.

Some user agents take rather a long time to be detected, for example the following user agent takes over 20 seconds to be detected, and causes CPU usage to increase: "Mozilla/6.0 (Windows; U; Windows NT 7.0; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.9 (.NET CLR 3.5.30059)"

Is there a specific cause for this user agent taking so long to be parsed?

Below are a few of the other problem user agents with their parsing times (in milliseconds).

21609   Mozilla/6.0 (Windows; U; Windows NT 7.0; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.9 (.NET CLR 3.5.30059) 
8549    Mozilla/5.0 Windows NT 6.1 WOW64 rv 16.0 Gecko/20100101 Firefox/16.0 
3468    Mozilla/5.0 (Linux; U; Android 4.3; en-ie; HTC_One/3.63.161.6 Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 
1850    Mozilla/5.0 (Linux; Android 4.4; Nexus 4 Build/KRT16S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.59 Mobile Safari/537.36 

This issue is preventing me from using the project in production, so any help, fixes or pointers as to what is causing the speed issues would be appreciated!

dgomesbr commented 10 years ago

@billthornton got any news on this? I'm about to migrate a php project and a few other java projects to play and without wurfl support this won't be possible.

billthornton commented 10 years ago

We ended up moving to the Java wurfl library as we had a lot of odd user agents causing CPU spikes on our web servers.

filosganga commented 10 years ago

Sorry guys for this issue. Unfortunately I don't have too much time to work on this project. In addiction take note that it is far from be precise as the java API because it has lot of custom user-agent specific logic missed in here.

BTW I will try to take a look into this this week and will come back with a solution/explanation On Apr 27, 2014 4:25 PM, "Bill" notifications@github.com wrote:

We ended up moving to the Java wurfl library as we had a lot of odd user agents causing CPU spikes on our web servers.

— Reply to this email directly or view it on GitHubhttps://github.com/filosganga/scala-wurfl/issues/5#issuecomment-41499500 .

dgomesbr commented 10 years ago

@billthornton thanks for the reply, I'll try to import the java objects on it. @filosganga no problem man, once I'm used to scala, I'll probably contribute to it, for now I'll just use the java api imported to scala.