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

Better performance of an IncludeDescriptor #3311

Merged
merged 1 commit into from
Jul 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Add a Swift Package Manager packgae ([#3308](https://github.com/realm/realm-core/pull/3308)).

### Fixed
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
* None.
* Constructing an `IncludeDescriptor` made unnecessary table comparisons. This resulted in poor performance for subscriptions
using the `includeLinkingObjects` functionality. ([#3311](https://github.com/realm/realm-core/issues/3311), since v5.18.0)

### Breaking changes
* None.
Expand Down
4 changes: 2 additions & 2 deletions src/realm/views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,12 @@ IncludeDescriptor::IncludeDescriptor(const Table& table, const std::vector<std::
size_t link_ndx = 0;
for (auto link : links) {
if (bool(link.from)) { // backlink
REALM_ASSERT(cur_table == link.from->get_link_target(link.column_ndx));
REALM_ASSERT_DEBUG(cur_table->get_name() == link.from->get_link_target(link.column_ndx)->get_name());
auto& col = tf::get_column(*link.from, link.column_ndx);
columns.push_back(&col);
backlink_source.push_back(link.from);
if (auto link_col = dynamic_cast<const LinkColumnBase*>(&col)) { // LinkColumn and ListColumn
if (link_col->get_target_table() != *cur_table) {
if (link_col->get_target_table().get_name() != cur_table->get_name()) {
// the link does not point to the last table in the chain
throw InvalidPathError(util::format("Invalid INCLUDE path at [%1, %2]: this link does not "
"connect to the previous table ('%3').",
Expand Down