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

Opening a synced Realm in Realm Kotlin is slower than Realm Java #1073

Open
cmelchior opened this issue Oct 14, 2022 · 2 comments
Open

Opening a synced Realm in Realm Kotlin is slower than Realm Java #1073

cmelchior opened this issue Oct 14, 2022 · 2 comments

Comments

@cmelchior
Copy link
Contributor

cmelchior commented Oct 14, 2022

Even after #1046 was fixed, opening a synchronized Realm in Realm Kotlin is still slower than on Realm Java and we need to investigate why.

Right now my guess is that either our schema-generation code or spinning up background notifiers is slowing things down, but this will need to be investigated. It might be investigated to #908

The project that shows this issue has a difference of 3.6 seconds, 4.4 seconds on Java, and 8 seconds on Kotlin. This includes downloading the Realm data from the server. See https://jira.mongodb.org/browse/HELP-37904 for more information.

4.4 seconds is a lot of time though, I would be surprised if it took that long to spin up a few thread pools and reading the schema. So maybe there is something else we are missing.

This ticket just covers discovering what the root cause of the problem is.

@cmelchior
Copy link
Contributor Author

I believe @clementetb was looking into this at some point and we measured this at some point and speculated if it would make sense to find a way to bulk-send all schema information through JNI rather than now where we go through the JNI layer for each property.

We also need to look into Realm Java and see if adopting the same pattern in Kotlin would make sense.

@sergpetrov
Copy link

@cmelchior @clementetb Hi!
Any news about fixing the performance issue?

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

No branches or pull requests

2 participants