-
Notifications
You must be signed in to change notification settings - Fork 169
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
Compression for leaf Mixed arrays of integers and collection in mixed. #7501
Compression for leaf Mixed arrays of integers and collection in mixed. #7501
Conversation
…mpression_with_nested_collections
…ested_collections
0ec1a67
to
51a8480
Compare
…mpression_with_nested_collections
Pull Request Test Coverage Report for Build nicola.cabiddu_1546Details
💛 - Coveralls |
b98ccfb
to
45402aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes needed....
src/realm/cluster.cpp
Outdated
// This flag is used to differentiate this while descending the | ||
// cluster. | ||
const bool collection_in_mixed = true; | ||
const bool compress = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't simply set this to true. We must pass in the surrounding value instead.
src/realm/cluster.cpp
Outdated
// temporary disable mixed. in order to re-enable them in a separate PR | ||
|
||
/* | ||
In order to know how Mixed stores things, we need to take in consideration this enum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to say we need to take into account the use of the following sub-arrays (and not the enum)
src/realm/cluster.cpp
Outdated
}; | ||
Note: | ||
1. entry at index 0 is the composite array (the main information about the data is stored, it can | ||
either be a small int <32 bit or a ref to the array where the actual data is stored). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the word 'ref' here is misleading. It is the offset into the relevant other array.
src/realm/cluster.cpp
Outdated
} | ||
else if (i == 5) { // unique keys associated to collections in mixed | ||
written_leaf.set_as_ref( | ||
i, Array::write(rot.get_as_ref(), m_alloc, out, only_modified, true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know if these keys are signed integers we can compress? Or is it an unsigned integer array (which we don't compress at the moment)..
also: we should never compress if the compress argument is false, so we can't just pass in true here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are int64_t
… we can compress them, but obviously only if we got the compress flag set to true… nice catch!!!.
src/realm/cluster.cpp
Outdated
if (i < 3) { // composite, int, and pair_int | ||
// integer arrays | ||
written_leaf.set_as_ref( | ||
i, Array::write(rot.get_as_ref(), m_alloc, out, only_modified, true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't simply compress here. Only if "compress" is true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
What, How & Why?
Enable support for compressing Mixed and Collection in Mixed.
☑️ ToDos
bindgen/spec.yml
, if public C++ API changed