Realm is too slow on Android first call when compared to iOS
See original GitHub issueGoal
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
Issue Analytics
- State:
- Created 6 years ago
- Comments:32 (19 by maintainers)
Top Results From Across the Web
Why are single transactions so slow? - Stack Overflow
2 Answers 2 · For every write, you are re-opening the database (i.e. within storeInDb you are calling Realm. · You shouldn't need...
Read more >The things I've learned using Realm | by Gabor Varadi - Medium
In this article, I try to sum up all the things I've learned from using Realm, and how it all relates with the...
Read more >Why does an Android phone slow down with time but iOS ...
Well, it is a common view that Android slows down with time compared to iOS, there are a few reasons for this view....
Read more >Realistic Realm - lessons learned after using it for 1.5 years
Android application has been written in Kotlin from the very beginning, used offline-first approach, i.e. when all the data displayed on the ...
Read more >Realm: Create reactive mobile apps in a fraction of the time
Apps using Realm can target both iOS and Android. React Native 0.31.0 and later is supported. Installation. Create a new React Native project:....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

+1
This is a very concerning issue for us to deal with. Are there any updates in regards to this? We have a major customer who have indefinitely postponed going live on our production because of this challenge.
Any update on this? I need a more comparative result to Realm for iOS.