Skip to content
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

Initialize op objects with all properties #71

Merged
merged 1 commit into from
Mar 24, 2016
Merged

Initialize op objects with all properties #71

merged 1 commit into from
Mar 24, 2016

Conversation

avital
Copy link
Contributor

@avital avital commented Mar 24, 2016

This way, op objects won't change form later when properties
are assigned. This makes the objects be optimized as structs
in V8.

This way, op objects won't change form later when properties
are assigned. This makes the objects be optimized as structs
in V8.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 96.132% when pulling ff4f80f on avital:make-ops-behave-like-structs into 3d12089 on share:master.

@nateps
Copy link
Contributor

nateps commented Mar 24, 2016

:-)

@nateps nateps merged commit fcc743d into share:master Mar 24, 2016
@nateps
Copy link
Contributor

nateps commented Mar 25, 2016

Actually I just realized the issue with this (and probably why I didn't do it originally) is that this causes Mongo to persist the keys set to null. That could end up taking some more space in Mongo, and we are only adding these properties for pub sub. Instead of this, we should probably copy the appropriate properties from the op and make a new object instead of mutating this object in publish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants