-
Notifications
You must be signed in to change notification settings - Fork 69
Dont use kotlin reflection (#1544) #1851
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
base: community
Are you sure you want to change the base?
Conversation
Realm welcomes all contributions! The only requirement we have is that, like many other projects, we need to have a Contributor License Agreement (CLA) in place before we can accept any external code. Our own CLA is a modified version of the Apache Software Foundation’s CLA. Our records show that CLA has not been signed by @kzotin. Please submit your CLA electronically using our Google form so we can accept your submissions. After signing the CLA you can recheck this PR with a |
PS. I've submitted the CLA form yesterday |
@cla-bot check |
Realm welcomes all contributions! The only requirement we have is that, like many other projects, we need to have a Contributor License Agreement (CLA) in place before we can accept any external code. Our own CLA is a modified version of the Apache Software Foundation’s CLA. Our records show that CLA has not been signed by @kzotin. Please submit your CLA electronically using our Google form so we can accept your submissions. After signing the CLA you can recheck this PR with a |
The cla-bot has been summoned, and re-checked this pull request! |
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
Would you mind adding a changelog entry to the PR? |
Updated the changelog |
} | ||
|
||
return companion | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We tested this fix in our project. The fix makes realm configuration creating much faster, but it slows down some queries. If realmObjectCompanionOrNull
called with Double::class
then this function works much slower (more than on 50%). Most likely because of Class.forName()
is called two times on every realmObjectCompanionOrNull
function call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double::class implements Parcelable in your case?) Twice call can be only for classes that implements Parcelable and only once when warm up the cache
Kotlin reflection is super slow on some old devices (~20seconds on cold start, see #1544 ), which is a blocker for us after migrating from realm-java to kotlin.
We've got such device, and fix was verified there