-
Notifications
You must be signed in to change notification settings - Fork 165
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
RCORE-2162: Add compression of strings in Mixed, Lst<String> and Dictionary #7804
Conversation
eef0397
to
af8c988
Compare
af8c988
to
c53ea27
Compare
@ironage please have a look at the modified client reset test. I think there is a problem as the 'after' callback is not synchonized with the main thread so we can't be sure that the callback has happened before the check is done. This has happened many times in ASAN runs. Do you think there is a better solution than the current fix? |
Pull Request Test Coverage Report for Build jorgen.edelbo_308Details
💛 - Coveralls |
e0bba68
to
07fde03
Compare
Pull Request Test Coverage Report for Build jorgen.edelbo_311Details
💛 - Coveralls |
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 small comments, overall LGTM.
Probably the client reset tests need some small changes, since we don't wait for a particular event, but we just sleep for a while before to checking the after reset callback.
src/realm/array_mixed.hpp
Outdated
@@ -135,6 +144,7 @@ class ArrayMixed : public ArrayPayload, private Array { | |||
mutable ArrayString m_strings; | |||
// Used to store nested collection refs | |||
mutable ArrayRef m_refs; | |||
mutable StringInterner* m_string_interner = nullptr; |
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.
Why do you need to cache the StringInterner
? Shouldn't m_strings
have the interner set?
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.
You are right. That should work.
@@ -1168,6 +1173,35 @@ REALM_FORCEINLINE void Obj::sync(Node& arr) | |||
} | |||
} | |||
|
|||
// helper functions for filtering out calls to set_string_interner() | |||
template <class T> | |||
inline void Obj::set_string_interner(T&, ColKey) |
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.
I think values.set_string_interner(m_table->get_string_interner(col_key));
can just go in the main template method. The interface is basically the same, isn't it?
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.
It is an optimization to only call that method for strings and mixed.
src/realm/table.cpp
Outdated
if (data_ref) | ||
Array::destroy_deep(data_ref, m_alloc); | ||
m_interner_data.set(col_ndx, 0); | ||
// m_string_interners[col_ndx]->update_from_parent(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.
remove this if not needed.
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.
👍
@@ -1048,6 +1048,13 @@ TEST_CASE("sync: client reset", "[sync][pbs][client reset][baas]") { | |||
}, | |||
std::chrono::seconds(20), std::chrono::milliseconds(500)); | |||
} | |||
// We can't be sure that the 'after' callback has been called yet | |||
timed_sleeping_wait_for( |
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.
Why isn't the wait at line 1049 enough? Maybe we should extend std::chrono::milliseconds(500)
to whatever it is needed.
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.
Ok - I thought I removed the 500 ms addition in line 1049. The 500 ms is just the time we sleep between each time we check the condition. If the condition is true, we will return immediately.
c4602d9
to
8f3f487
Compare
Pull Request Test Coverage Report for Build jorgen.edelbo_316Details
💛 - Coveralls |
8f3f487
to
2c8d86e
Compare
Pull Request Test Coverage Report for Build jorgen.edelbo_317Details
💛 - Coveralls |
What, How & Why?
☑️ ToDos
bindgen/spec.yml
, if public C++ API changed