Uploaded image for project: 'Realm Java SDK'
  1. Realm Java SDK
  2. RJAVA-256

Realm is too slow on Android first call when compared to iOS

      <!---

      Questions: If you have questions about how to use Realm, ask on
      StackOverflow.
      We monitor the realm tag.

      Feature Request: Just fill in the first two sections below.

      Bugs: To help you as fast as possible with an issue please describe your issue
      and the steps you have taken to reproduce it in as many details as possible.

      -->

      Goal

      > What do you want to achieve?
      Faster return for realm.getInstance() call the first time it is executed

      Expected Results

      > I am noticing the iOS Realm is much faster at returning the Realm Instance the first time it is called, significantly faster (with the same schema setup).

      Actual Results

      > I am noticing it takes upwards of 1 second on the Samsung s8. On some devices it takes up to 8-9 seconds.

      Steps & Code to Reproduce

      > Describe your current debugging efforts.
      Please run this (https://github.com/abhi-scenedoc/realmTest) sample project that I have put together which displays the results (time taken is ms).

      Code Sample

      long startTime = System.currentTimeMillis();
      Realm realm = Realm.getDefaultInstance(); //first time it's called after application is opened
      long result = (System.currentTimeMillis() - startTime);
      Log.d(REALM, "total time = " + result);
      
      

      Version of Realm and tooling

      Realm version(s): 3.7.2(testing) and 3.3.1 (in our production app)

      Realm sync feature enabled:no

      Android Studio version: 2.3.3

      Which Android version and device: Samsung S8 - Android 7.0

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: