Skip to content
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

RealmKotlin.copyToRealm magnitures slower than RealmJava.insertOrUpdate #1827

Open
BlueCobold opened this issue Aug 30, 2024 · 2 comments
Open

Comments

@BlueCobold
Copy link

How frequently does the bug occur?

Always

Description

I have migrated from RealmJava 10.16.0 to RealmKotlin 1.16.0 and I have a piece of conversion code which creates RealmObjects from my model classes and then used insertOrUpdate to update the realm file. However, after migrating to RealmKotlin, I tried using copyToRealm with UpdatePolicy.ALL. And I also tried to sequentially query and update all the properties of the existing RealmObjects in my db with the values of my model files and in both cases, the time it takes to update all the objects (quite a lot) increased from ~2 seconds to about 20-40. This is a significant increase in execution time. The issue does not exist on RealmSwift either.

I am a bit helpless here at the moment, because I don't want to be stuck with RealmJava for too long anymore, but this issue is blocking a migration effectively.

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

Fetch all objects from the realm including nested/children, then deep-clone the objects and call a copyToRealm(data, UpdatePolicy.ALL) in a new write-block.

Version

1.16.0

What Atlas App Services are you using?

Local Database only

Are you using encryption?

Yes

Platform OS and version(s)

Android any

Build environment

Android Studio version: 2023.3.1
Android Build Tools version: 34
Gradle version: 8.4

Copy link

sync-by-unito bot commented Aug 30, 2024

➤ PM Bot commented:

Jira ticket: RKOTLIN-1124

@BlueCobold
Copy link
Author

Looks like this is only happening with attached debugger. I'm calling this closed, but it is still very inconvenient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant