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

performance improvements #32

Merged
merged 3 commits into from
Jul 26, 2016
Merged

performance improvements #32

merged 3 commits into from
Jul 26, 2016

Conversation

evgenigourvitch
Copy link
Contributor

Hello guys,

We are using this kindly shared package and since we are using it in heavy loaded server environment (~400K requests/sec) each millisecond counts, so I added some flexibility to
the current implementation without affecting the base capabilities.
It allows to detect only selected parts (for example not to parse Device if not needed, like in our use-case).
I've also added some sorting capability of the regexp arrays to allow to reshuffle them into descending order by the most successful matches.

May be you will find it usable.
Best regards and thank you for the incredible package!

@elsigh
Copy link
Contributor

elsigh commented Jul 25, 2016

Can you try the perf benchmarks with this change? See #26

@evgenigourvitch
Copy link
Contributor Author

=== RUN TestOSParsing
--- PASS: TestOSParsing (0.04s)
=== RUN TestUAParsing
=== RUN TestDeviceParsing
=== RUN TestGenericParseMethodConcurrency
--- PASS: TestGenericParseMethodConcurrency (0.51s)
--- PASS: TestDeviceParsing (9.01s)
--- PASS: TestUAParsing (14.64s)
PASS
**

BenchmarkParser-4 50 22327841 ns/op
BenchmarkParserWithOptions-4 100 12900935 ns/op

**
ok github.com/streamrail/uap-go.evg/uaparser 17.813s

@elsigh elsigh merged commit fe9dfa4 into ua-parser:master Jul 26, 2016
@elsigh
Copy link
Contributor

elsigh commented Aug 10, 2016

Is this PR the source of Issue #33?

@evgenigourvitch
Copy link
Contributor Author

Actually, I can see no issue, but as designed behaviour, like I discribed
in the issue's comment.
Thanks.

On Wed, Aug 10, 2016 at 7:37 PM, Lindsey Simon [email protected]
wrote:

Is this PR the source of Issue #33
#33?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#32 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ATeefGDKFJAdFdtQf4ipVaxJHZN1qPrJks5qef5ggaJpZM4JUnKZ
.

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

Successfully merging this pull request may close these issues.

2 participants