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

Track number of documents in SessionCollectionView #10017

Closed
wants to merge 1 commit into from

Conversation

koszta
Copy link
Contributor

@koszta koszta commented Jun 21, 2018

Fixes issue #9828

@veered
Copy link
Contributor

veered commented Jun 21, 2018

@koszta You verified that this resolved your performance issues?

@koszta
Copy link
Contributor Author

koszta commented Jun 21, 2018

@veered Yes, thanks for the hint!

In the reproduction repo there is a fix branch using the patched ddp-server:
https://github.com/fuww/blocked-unsub/tree/fix

Now it is not blocking the event loop for more than ~20-30ms while unsubscribing with 2000 published documents.

@nathan-muir
Copy link
Contributor

nathan-muir commented Jun 25, 2018

Awesome! Removing the call to _.isEmpty reduces the time to unsub from 5s to 500ms (for a production dataset)

Just a thought: instead of the counter, we could also use a Map which has a .size property & better suited to adding/removing items and iteration. (eg. devel...nathan-muir:nm-ddp-perf)

@veered
Copy link
Contributor

veered commented Jul 2, 2018

This definitely seems worth merging (perhaps after making the change suggested by @nathan-muir )!

@benjamn
Copy link
Contributor

benjamn commented Jul 4, 2018

I agree that using a Map would make this easier!

@koszta
Copy link
Contributor Author

koszta commented Jul 6, 2018

I also agree, but there is DiffSequence.diffObjects called with self.documents, which I assume would not work with a Map

@koszta
Copy link
Contributor Author

koszta commented Jul 16, 2018

Closing this in favor of #10053

@koszta koszta closed this Jul 16, 2018
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.

4 participants