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

GetTraceDataProviders in provider.hpp has high CPU usage and takes 2-3 second to return? #240

Open
rjadidi920 opened this issue Jul 14, 2024 · 0 comments

Comments

@rjadidi920
Copy link

rjadidi920 commented Jul 14, 2024

I noticed that during my function that creates krabs::providers and registers them, I get a high CPU usage which seemed odd.

I traced the problem to the following line of code in provider.hpp:

    template <typename T>
    provider<T>::provider(const std::wstring &providerName)
            ....
            hr = allProviders->GetTraceDataProviders(NULL);  // This line is causing high cpu usage and takes 2-3 seconds to return. tested in Windows 10 and Windows 7.

My question is, is there anyway to improve this? Because right now, for every provider that I want to create and register, it takes 2-3 second and high cpu usage because of this, so imagine when I try to register 10 providers..

I wanted to use the GUID version of the provider constructor, but the problem is I don't see it validating the GUID, because i might use providers that exist in some systems but don't exist in others, so I need to check if the GUID provider exist or not to begin with.

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

1 participant