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

Slow Initial Parse #52

Closed
Mike-E-angelo opened this issue Feb 23, 2022 · 4 comments
Closed

Slow Initial Parse #52

Mike-E-angelo opened this issue Feb 23, 2022 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@Mike-E-angelo
Copy link

I wanted to first thank you for a wonderful library and API. It is well-designed and easy to use. It is, in fact, exactly what I am looking for.

The only issue that I have is that it appears the following takes 5 seconds to run the first time (subsequent executions are as expected):

var sut = new DeviceDetector("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36");
sut.Parse();

Is this expected/known behavior? 5 seconds would increase my application startup time by ~25% which would be a drag, so making sure before I do so. :)

Thank you for any assistance/context/insight you can provide.

@totpero
Copy link
Owner

totpero commented Feb 24, 2022

Hi @Mike-E-angelo,
Did you try to use Cache or MSRegexCompiledEngine ?

@Mike-E-angelo
Copy link
Author

Thank you for the reply @totpero. I did try those and it still seems to clock in at over 5 seconds when I run the test:

You can view the test here for your review:
https://github.com/DragonSpark/Framework/blob/aec495ab9622e58fc6412beff972c45b793d4543/DragonSpark.Presentation.Testing/IsBotTests.cs#L28-L35

@asadullazadeh
Copy link

the same

@totpero totpero added the help wanted Extra attention is needed label Mar 5, 2023
@savage8811
Copy link

savage8811 commented Mar 29, 2023

Did you try the new version 6.1.0? That version contains performance improvements. Im my case the initial parse is much faster.

@totpero totpero closed this as completed Jun 2, 2024
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

4 participants