Skip to content
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

Very long parsing #3

Closed
pierrocknroll opened this issue May 31, 2018 · 2 comments
Closed

Very long parsing #3

pierrocknroll opened this issue May 31, 2018 · 2 comments

Comments

@pierrocknroll
Copy link

Hello, and thank you for your great parser !

The only problem I'm facing is that the parsing is long, very much longer than other parsers like woothee, ua-parser or httpagentparser, BUT your results are more accurate :)

For example, with a simple script who only parse 400 lines, ua-parser made it in 1.009 seconds, and device_detector 219s.

Is there any reason ? Maybe can you look how they made it compared to you ?

Thanks a lot

@thinkwelltwd
Copy link
Owner

(This is why there's no pypi release yet 😉 )

Regex compilation isn't cached. I didn't decide whether to compile when loading from yaml, or to lazily compile & cache when first used. The lazy mode is better for short runs but will use more memory. It's implemented in commit 5afc3c4.

Secondly, it'll always be at least an order of magnitude slower than the libraries you mention because of the device model parsing, which the other libraries don't support. If you don't need device info, then those libraries are the way to go, and I'd have used one of those myself instead.

@pierrocknroll
Copy link
Author

Wow, your last commit improves the performances a lot !!
Thanks for your answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants