Uploaded image for project: 'Realm Kotlin'
  1. Realm Kotlin
  2. RKOTLIN-922

Slow queries with embedded objects when compared to Realm Java

      How frequently does the bug occur?

      Always

      Description

      During our migration from Realm Java to Realm Kotlin in our Android project, a severe performance drop in some of our queries was observed.

      For reference, we have a Realm Object with the following schema:

      class BookRealm {
         @PrimaryKey var idRealm: String = EMPTY_STRING,
          var metas: RealmList<MetadataRealm> = realmListOf(),
      }
      

      The MetadataRealm is has the following schema:

      class MetadataRealm(
          var key: String = EMPTY_STRING,
          var values: RealmList<String?> = realmListOf()
      ) : EmbeddedRealmObject
      

      For our test, we have 100 BookRealm objects. On average, each one of them has 10 MetadataRealm, which all have a single object in {{values }}.

      Fetching all BookRealm objects and accessing their metas objects is on average, 5 times slower in Kotlin.

      Stacktrace & log output

      No response

      Can you reproduce the bug?

      Always

      Reproduction Steps

      No response

      Version

      1.10.0

      What Atlas App Services are you using?

      Local Database only

      Are you using encryption?

      Yes

      Platform OS and version(s)

      Android 13

      Build environment

      No response

            Assignee:
            christian.melchior@mongodb.com Christian Melchior (Inactive)
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: