-
Notifications
You must be signed in to change notification settings - Fork 901
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
Skip excess cloning of JSONized object_changes
#1189
Skip excess cloning of JSONized object_changes
#1189
Conversation
ec58654
to
8d3963e
Compare
Somehow, this makes more sense to me when I see it as a separate PR. Looks good, I'm just going to add some comments. |
Hmm this may be a breaking change, I'm not sure. Until now, we have passed a plain However, I think this change would not affect the reference implementation of What do you think? Should we treat this as a breaking change? |
I've added some comments, and fixed the |
I feel that change from On the other hand I'm able to think up some dummy Looks like it's better to mark the change as rarely breaking, to be honest with consumers.. |
Please see 309a8c1, in which I preserve the public API by using - changes = PaperTrail.config.object_changes_adapter.diff(changes)
+ changes = PaperTrail.config.object_changes_adapter.diff(changes.to_hash) What do you think? |
LGTM! Now there is no any chance to break the things for consumers :) |
* Skip excess cloning of JSONized `object_changes` * Suggestions for PR 1189, to be squashed
Every
clone
-like operation over theobject_changes
column will allocate theO(n)
of RAM, wheren
is a kind of complexity ofobject
model in general and applied changes in particular.Lets skip excess
object_changes.to_hash
call when theobject_changes
is a kind ofjson
column.master
(if not - rebase it).code introduces user-observable changes.
and description in grammatically correct, complete sentences.