uap-ruby
uap-ruby copied to clipboard
Remove UserAgentParser.parse
It causes unexpected performance problems (#4 #5 #13). The simpler UserAgentParser.new.parse should be less confusing.
A backwards incompatible change for v3.
@toolmantim Is this still relevant?
@wallin This is still relevant. We hit this footgun using the class method in a rails request - loading the yaml and compiling the regexes on every request. This added about 40-50ms per-request, which is quite unexpected and one of those things that's really easy to miss when you first introduce using this gem - though I appreciate the readme does attempt to address it.
If the docs clearly stated "Expect this method to take 50ms" I suspect nobody would use it. I support this issue.
First step could be to add a deprecation warning maybe? That could already educate and also help transition.