Hi,
I was using this library for a project recently, and was really surprised that ParseUserAgent was significantly slower than Parse. After digging a bit into the code, I think this is because ParseUserAgent is not using the internal cache, whereas Parse is.
As both methods are documented in the README, I was expecting both to have similar performance, with ParseUserAgent being a bit faster because it has to parse less. Currently, both methods seem to be recommended for regular use, but ParseUserAgent seems significantly worse than Parse.
In my opinion it might be helpful to document this behavior in the README or change it, because it is currently faster to use Parse(ua_string)['user_agent'] instead of ParseUserAgent.
Hi,
I was using this library for a project recently, and was really surprised that
ParseUserAgentwas significantly slower thanParse. After digging a bit into the code, I think this is becauseParseUserAgentis not using the internal cache, whereasParseis.As both methods are documented in the README, I was expecting both to have similar performance, with
ParseUserAgentbeing a bit faster because it has to parse less. Currently, both methods seem to be recommended for regular use, butParseUserAgentseems significantly worse thanParse.In my opinion it might be helpful to document this behavior in the README or change it, because it is currently faster to use
Parse(ua_string)['user_agent']instead ofParseUserAgent.