• E
    Avoid generating full changes hash on every save · b9e1c0c4
    Eugene Kenny 提交于
    `changed_attribute_names_to_save` is called in `keys_for_partial_write`,
    which is called on every save when partial writes are enabled.
    
    We can avoid generating the full changes hash by asking the mutation
    tracker for just the names of the changed attributes. At minimum this
    saves one array allocation per attribute, but will also avoid calling
    `Attribute#original_value` which is expensive for serialized attributes.
    b9e1c0c4
attribute_mutation_tracker.rb 2.5 KB