diff options
author | Eugene Kenny <elkenny@gmail.com> | 2018-04-08 22:56:31 +0100 |
---|---|---|
committer | Eugene Kenny <elkenny@gmail.com> | 2018-04-08 22:56:31 +0100 |
commit | b9e1c0c4d7c67a65c2ea63e7f0925f4d0da306aa (patch) | |
tree | ee77eb11f5cc7ff60a1096801dc89b06b456c770 /activerecord/RUNNING_UNIT_TESTS.rdoc | |
parent | d729bc748811339c7e536f4ca98e91801e14c6f4 (diff) | |
download | rails-b9e1c0c4d7c67a65c2ea63e7f0925f4d0da306aa.tar.gz rails-b9e1c0c4d7c67a65c2ea63e7f0925f4d0da306aa.tar.bz2 rails-b9e1c0c4d7c67a65c2ea63e7f0925f4d0da306aa.zip |
Avoid generating full changes hash on every save
`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.
Diffstat (limited to 'activerecord/RUNNING_UNIT_TESTS.rdoc')
0 files changed, 0 insertions, 0 deletions