Skip to content

Performance overhead of subscriptions #2775

Answered by nirinchev
peppy asked this question in Q&A
Discussion options

You must be logged in to vote

This is because Refresh() will block until all subscription handlers have fired. Not only that, but it also forces the otherwise asynchronous changeset calculation to happen synchronously. This is to ensure correctness when notifications are delivered (i.e. they need to see the Realm in a state that is consistent with the changeset indices). I don't know how feasible this is, but the most obvious approach to alleviate this is to move away from calling Refresh manually and instead let Realm refresh itself. For this to work though, you'll need to install a synchronization context on your main thread, which may have unintended consequences for other parts of your code (e.g. async continuatio…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@peppy
Comment options

@nirinchev
Comment options

@peppy
Comment options

@nirinchev
Comment options

@peppy
Comment options

Answer selected by peppy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants