By using ObjectSpace.memsize_of() in rails, i noticed active record object occupies lesser space than hash. Ex : Say a = User.last , b = a.attribues, c = a.json .
I got ObjectSpace.memsize_of(a) < ObjectSpace.memsize_of(b) ObjectSpace.memsize_of(c). why is this and how is it possible ?
Aucun commentaire:
Enregistrer un commentaire