title: What is the cost of refreshing a Realm?
body: <p>I have read the docs and understand that in many cases you do not need to manually call <code>refresh</code> on the <code>Realm</code> instance. However, in this pretty common scenario it turned out to be necessary because the completion block may query the Realm before the start of the next run loop.</p>
  
  <pre><code>dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
      [[RLMRealm defaultRealm] transactionWithBlock:^{
          // Add some RLMObjects
      }];
  
      if (completion) {
          dispatch_async(dispatch_get_main_queue(), ^{
              [[RLMRealm defaultRealm] refresh]; // necessary if it queries realm
              completion();
          });
      }
  });
  </code></pre>
  
  <p>I thought I was being a good citizen by performing write operations on a background thread, but now that I have to call <code>refresh</code>, I'm wondering if the overhead involved in this call defeats the point of doing the background processing.</p>
  
  <p>So my questions are:</p>
  
  <p>1) What is the performance cost of calling <code>refresh</code> on the <code>Realm</code>?</p>
  
  <p>2) Adding just one object to the realm in this pattern probably is 
  pointless. After adding how  many objects in this pattern would I see an advantage over the alternative of just performing the write transaction on the main thread synchronously?</p>