-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update from Realm 7.0.8 to 10.4.0 is very slow #7426
Comments
I was indeed able to update my database. It took around 663 seconds. |
@jpmcosta thanks for reporting the issue and providing an example project. The reason it takes time to open is that there is a file version upgrade between those versions and Realm has to migrate it to the new format. We have escalated the issue to the core team to know why it takes this great amount of time to complete. |
We recognize that this is indeed slow. We are working on a solution to fix this. |
Expected fix released in Core v11.0.0-beta.6 |
This has been released now and will be released shortly in SDKs. |
10.6.0 was released with a fix for this. |
Goal
I'm trying to update my application's local and unencrypted database from version 7.0.8 to version 10.4.0.
Actual Results
The update from version 7.0.8 to version 10.4.0 seems to be very slow and I still wasn't able to complete the operation once in my testing device. While it might have completed if I left it long enough time in the foreground (I have waited around 10 minutes), I don't think I can ask users to have the application in the foreground for several minutes waiting for it complete the update. Plus, I believe it might be exceeding the maximum allowed time in the background.
I also have noticed that when there's a call to
Realm.getInstanceAsync()
in the UI thread while Realm is already trying to update the database (from aRealm.getInstance()
call in a background thread or a different call toRealm.getInstanceAsync()
), that call will block the UI thread, causing an ANR. I have worked around that issue, but I thought I should mention it.Steps & Code to Reproduce
I have created a simplified Android project to reproduce the issue:
https://github.com/jpmcosta/RealmTestProject/tree/e53e945d35ea6faefaf53e26eb4c34c486c4369b
The project includes a
default.realm
file that was generated in Realm 7.0.8 and should be used to test the update.With that file, the update takes:
While it does complete there are a few differences to my original database:
Version of Realm and tooling
Realm version(s): 7.0.8, 10.4.0
Realm Sync feature enabled: No
Which Android version and device(s): API 29 (device and emulator)
Thank you for taking a look into this.
The text was updated successfully, but these errors were encountered: