-
Notifications
You must be signed in to change notification settings - Fork 896
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
Refactor Api::Environment #14986
Refactor Api::Environment #14986
Conversation
@imtayadeway can you run a performance test with before (hash) and after (set), of GET 1000 VM's with expand=resources. Thanks. |
This pull request is not mergeable. Please rebase and repush. |
😍 I love it! |
e7fbfa6
to
f1a3b03
Compare
Checked commits imtayadeway/manageiq@3742b42~...f1a3b03 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@abellotti OK I have some numbers for you! Couldn't quite get to 1000 but I had 714 Vms in my database so I limited to 700 in my query. I ran the query 20x on each run (after warming up) so hopefully any big quirks will have been somewhat evened out: Here's before:
And after:
So the data says: slightly faster ;) Pinch of salt though, I wouldn't want to seriously make that claim - there are many extraneous things that could account for that. Importantly though, I think we can say it's in the same ball park. LMK if I can do anything else! |
This is fine @imtayadeway same ballpark, less in user more in system. Thanks for running the tests 🎵 |
LGTM !! 👍 |
Took some suggestions out of #14624 and bundled them with some other refactorings. The result is a little longer, but I think it adds clarity and consistency.
Among the changes:
begin
blocknormalized_attrs
data using sets instead of hashes (we don't use the values, we just assign all values totrue
normalized_attrs
hash altogether, which should lower the memory footprint of this module, since it duplicated some other data which never got GC'dApi.<type>_attribute?
helper methods@Fryguy thanks for some of these suggestions!
@miq-bot add-label api, refactoring
@miq-bot assign @abellotti