Skip to content

Add Query to Target ID Map #2179

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

Merged
merged 4 commits into from
Sep 17, 2019

Conversation

schmidt-sebastian
Copy link
Contributor

This PR replaces the O(n) loop in getQueryData() with a key lookup in an ObjectMap. This follows the precedent in SyncEngine (and maybe eventually leads us down the path of merging the different query tracking mechanisms).

return PersistencePromise.resolve();
}
});
const targetId = this.targetIdByQuery.get(query);
Copy link
Contributor Author

@schmidt-sebastian schmidt-sebastian Sep 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now have a map to look up targetIds for active queries, so we no longer need to go to the QueryCache.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call!

@schmidt-sebastian schmidt-sebastian changed the title Mrschmidt/lookup Add Query to Target ID Map Sep 17, 2019
Copy link
Contributor

@mikelehen mikelehen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

return PersistencePromise.resolve();
}
});
const targetId = this.targetIdByQuery.get(query);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call!

@schmidt-sebastian schmidt-sebastian merged commit 0618849 into mrschmidt/indexfree-master Sep 17, 2019
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/lookup branch October 10, 2019 22:55
@firebase firebase locked and limited conversation to collaborators Oct 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants