Skip to content

Conversation

kzotin
Copy link

@kzotin kzotin commented Oct 31, 2024

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

Copy link

cla-bot bot commented Oct 31, 2024

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 @cla-bot check comment. The GitHub usernames you file there will need to match that of your Pull Requests. If you have any questions or cannot file the CLA electronically, make a comment here and we will be happy to help you out.

@kzotin
Copy link
Author

kzotin commented Oct 31, 2024

PS. I've submitted the CLA form yesterday

@stavfx
Copy link
Contributor

stavfx commented Nov 1, 2024

@cla-bot check

Copy link

cla-bot bot commented Nov 1, 2024

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 @cla-bot check comment. The GitHub usernames you file there will need to match that of your Pull Requests. If you have any questions or cannot file the CLA electronically, make a comment here and we will be happy to help you out.

Copy link

cla-bot bot commented Nov 1, 2024

The cla-bot has been summoned, and re-checked this pull request!

@stavfx
Copy link
Contributor

stavfx commented Nov 5, 2024

@kzotin I think you signed the form as "@kzotin" instead of "kzotin" and that's why the cla-bot is still failing

@MrJohn10
Copy link

@cla-bot check

@cla-bot cla-bot bot added the cla: yes label Jan 17, 2025
Copy link

cla-bot bot commented Jan 17, 2025

The cla-bot has been summoned, and re-checked this pull request!

@clementetb clementetb added the no-jira-ticket Skip checking the PR title for Jira reference label Jan 20, 2025
@clementetb
Copy link
Contributor

Would you mind adding a changelog entry to the PR?

@kzotin
Copy link
Author

kzotin commented Jan 21, 2025

Updated the changelog

}

return companion
}

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.

Copy link

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

@kzotin kzotin mentioned this pull request Mar 18, 2025
LouisCAD added a commit to Infomaniak/realm-kotlin that referenced this pull request Aug 19, 2025
This should fix realm#1544

See this PR that was the inspiration: realm#1851
LouisCAD added a commit to Infomaniak/realm-kotlin that referenced this pull request Aug 19, 2025
This should fix realm#1544

See this PR that was the inspiration: realm#1851
LouisCAD added a commit to Infomaniak/realm-kotlin that referenced this pull request Sep 10, 2025
This should fix realm#1544

See this PR that was the inspiration: realm#1851
@LouisCAD
Copy link

Hello, thanks to https://github.com/XilinJia/krdb, we published a fork on Maven Central yesterday, supporting all targets (iOS and macOS included), and we included a fix for this issue.

https://github.com/Infomaniak/realm-kotlin/releases/tag/3.2.8-2

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

Labels

cla: yes no-jira-ticket Skip checking the PR title for Jira reference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants