realm-kotlin
                                
                                 realm-kotlin copied to clipboard
                                
                                    realm-kotlin copied to clipboard
                            
                            
                            
                        First constructor call of RealmConfiguration.Builder(realmClasses) takes 5+ seconds
How frequently does the bug occur?
Always
Description
Using certain devices, the first constructor call of RealmConfiguration.Builder() takes 5 or more seconds. Consecutive calls within the same process takes just a millisecond. This can be reproduced every time using the same devices. Note that neither a build() is being called, nor a Realm is being opened. Just creating a Builder on itself takes quite long and it does seem to correlate to the number of classes passed.
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
Use my schema and call the constructor. I can provide the schema or a minimal app if required.
        val schema = ...
        var t1 = System.currentTimeMillis()
        RealmConfiguration.Builder(schema)
        Log.d(LogTAG, "Init builder: ${System.currentTimeMillis() - t1}") // ~5000 ms
        t1 = System.currentTimeMillis()
        RealmConfiguration.Builder(schema)
        Log.d(LogTAG, "Init builder: ${System.currentTimeMillis() - t1}") // 0 ms
Version
2.2.0
What Atlas App Services are you using?
Local Database only
Are you using encryption?
Yes
Platform OS and version(s)
Android 8
Build environment
Android Studio version: Android Studio Koala Feature Drop | 2024.1.2 Android Build Tools version: gradle build tools 8.6, compile SDK 34 Gradle version: 8.7