These are chat archives for ManageIQ/manageiq/performance
okay, just got done wrapping my head around that post...
@djberg96 Okay, so what are you pondering about specifically?
was also looking at ActiveRecord::Model::Serializers::JSON
Been a while since I looked at it, but I am not so sure it is the
JSON serialization that was the issue, but what we are doing with it once it was unserialized.
From what I remember (correct me if I am wrong), we were downloading the data from the azure API, and then with the data we received, we would determine what objects types needed to be instantiated from that, massage the data into a
snake_cased format, and possibly define methods based on the keys from the result.
If I remember correctly, we did this for each object instantiated, not just for the objects as a whole. This has a plus of being "future proof" library (and avoids us being at the mercy of Azure's API changes), but a major downside of we are instantiating a lot of objects at once (MIQ's bread and butter), we eat that performance penalty for every object.
The brute force "screw it... I want all the perfs" solution would be to just hardcode ALL THE THINGS into
azure-armrest, and have methods like:
def some_azure_key_thing json["SomeAzureKeyThing".freeze] end def some_azure_key_thing=(new_val) json["SomeAzureKeyThing".freeze] = new_val end
All over the place, and it's "faster". But pretty sure nobody wants to do that...
from_jsonmethod which, combined with
attr_accessor, gives you an equivalent method for each hash key