Skip to content

Performance overhead of subscriptions #3537

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

You must be logged in to vote

Cool - I spoke with the team and we don't have explicit performance tests for this, but the overhead of individual subscriptions should scale linearly with a small constant factor for collections which don't see changes. Beyond 100(s) of individual subscriptions, we expect a single subscription with keypath filtering to be more efficient though, so once #3501 is released, you could optimize the use case like:

realm.All<BeatmapCollection>().SubscribeForNotifications((sender, changes) =>
{
  foreach (var inserted in changes.InsertedIndices)
  {
    var beatmapsCount = sender[inserted].BeatmapMD5Hashes.Count;
    CreateNewDrawableCollectionListItem(inserted, beatmapsCount); // Pseudocode
  }

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@bdach
Comment options

@nirinchev
Comment options

Answer selected by bdach
@bdach
Comment options

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