Object creating takes very long in ios (react native)

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Critical - P2
    • None
    • Affects Version/s: None
    • Component/s: None

      recently updated from 3.6.4 to 5.0.3.
      object creating takes much longer that it used to on both simulators and iphones + blocks ui.

      Expected Results

      quick creating as it used to be

      Actual Results

      average object creation takes about 400ms and blocks the ui

      Code Sample

      postRealm.write(() => {
      	if (cleanAll) {
      		let allPosts = postRealm.objects('post24').filtered('projectId = "' + projectId + '"');
      		let allLastUpdateTS = postRealm.objects('lastUpdateTS').filtered('projectId = "' + projectId + '" AND type = "post"');
      		postRealm.delete(allLastUpdateTS);
      		postRealm.delete(allPosts); 
      	}
      	
      	preparedPostArray.forEach(post => {
      		if (post && post.id) 
      			postRealm.create('post24', post, true);
      		else {
      			console.warn('post missing ID'); 
      		}
      	});
      
      	if (projectId && ignoreTimestamp)
      		postRealm.create('lastUpdateTS', { id: projectId + '_post', lastUpdateTS: newLastUpdateTS, projectId, type: 'post' }, true)
      });	
      

      Versions

      • Realm JS SDK Version: 5.0.3
      • React Native: 0.61.5
      • Client OS & Version: macOs Catalina 10.15.4

            Assignee:
            Lubo Blagoev
            Reporter:
            Unito Sync Bot
            Archiver:
            Marc Greenfield

              Created:
              Updated:
              Resolved:
              Archived: