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

Backport: Re-factor to fix high CPU usage on windows (#1562) #1598

Merged
merged 1 commit into from
May 10, 2016

Conversation

tsg
Copy link
Contributor

@tsg tsg commented May 9, 2016

  • Re-factor to fix high CPU usage on windows

This decouples getting the basic state information from getting the more
detailed information. The reason is that filtering only needs the name, but
the code was getting all details and then apply filtering. Getting the command
line is expensive on Windows, so that contributed to #1460.

What made it worse is that due to filtering, the command line cache was
invalidated on each run, which explains why topbeat was consuming more CPU when
filtering out processes than when not.

Fixes #1460.

This also pre-compiles the regexps, which brings some slight CPU usage improvements
and uncovers compilation errors earlier.

* Re-factor to fix high CPU usage on windows

This decouples getting the basic state information from getting the more
detailed information.  The reason is that filtering only needs the name, but
the code was getting all details and then apply filtering. Getting the command
line is expensive on Windows, so that contributed to elastic#1460.

What made it worse is that due to filtering, the command line cache was
invalidated on each run, which explains why topbeat was consuming more CPU when
filtering out processes than when not.

Fixes elastic#1460.

This also pre-compiles the regexps, which brings some slight CPU usage improvements
and uncovers compilation errors earlier.
@tsg
Copy link
Contributor Author

tsg commented May 10, 2016

Tests look good.

@ruflin ruflin merged commit 5688425 into elastic:1.2 May 10, 2016
@tsg tsg deleted the backport_1562 branch August 25, 2016 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants