-
Notifications
You must be signed in to change notification settings - Fork 897
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
Speed up widget generation #14224
Speed up widget generation #14224
Conversation
This avoids `recs.to_a` and uses `recs.klass` instead https://bugzilla.redhat.com/show_bug.cgi?id=1251259
Checked commit kbrock@9dab1c4 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/models/metric/helper.rb
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement 👍
@chessbyte @gtanzillo you ok marking this as Should be minimal risk (thought I'm unsure why we have to check every record that it is a |
WARNING: these numbers are not right |
Speed up widget generation (cherry picked from commit 15f7ba4) https://bugzilla.redhat.com/show_bug.cgi?id=1434150
Euwe backport details:
|
Reporting is bringing back all rows to check for data types.
For widgets, this was bringing back unnecessary data.
The change detects if the input is a query, and uses
ActiveRecord::Relation#klass
instead of fetching all rows and comparing them.https://bugzilla.redhat.com/show_bug.cgi?id=1251259
comments
before.4
after.4
EOM
The verbose numbers section.
If you note, the numbers below were used up top
comments
before.1
before.2
before.3
before.4
after.1
after.2
after.3
after.4
* Memory usage does not reflect 3,599,936 freed objects - before.1
* Memory usage does not reflect 2,200,252 freed objects - before.2
* Memory usage does not reflect 2,204,985 freed objects - before.3
* Memory usage does not reflect 2,204,873 freed objects - before.4
* Memory usage does not reflect 9,060 freed objects - after.1