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

Extremely slow performance on occassion #47

Open
majkinetor opened this issue Sep 3, 2021 · 1 comment
Open

Extremely slow performance on occassion #47

majkinetor opened this issue Sep 3, 2021 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@majkinetor
Copy link

Hi there.

We noticed 1 to 2 times per day that login lasts around 12s due to agent parsing. This is a graph in last 7 days in which you can see 9 peaks between 10 and 12s and and 5 peaks at around 2s:

image

Otherwise, its around 150ms. We have 10k cache enabled.

Any idea what could go wrong or how to troubleshoot this ? I really like the library but this things is a deal breaker. This is observed on our test web app environment which has very low number of logins per day (around 100).

@totpero totpero added the help wanted Extra attention is needed label Sep 12, 2021
@sanchezzzhak
Copy link

maybe try to implement the indexing of the device brand?
this reduces the number of iterations in the loop for known devices to 1 step instead of a full pass.
https://github.com/sanchezzzhak/node-device-detector/blob/523097d122e6f8a0766ef2f2cacf2e58c7ef30da/index.js#L475-L477

indexing generator itself is located here
https://github.com/sanchezzzhak/node-device-detector/blob/master/tests/tools/generate-indexes.js

this may help, it helped me to reduce count of CPU% and reduced the response for well known brands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants