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
Slow Performance in Writing after updated to 10.24.2 #7734
Comments
Hi @samrithyoeun |
FYI I just logged an issue as we updated from 10.9.0 to 10.24.2 and hit major performance issues with generating reports but this only seems to happen with the Synced realms and not when run with a local realm (same copy of the data). |
@samrithyoeun |
I'm seeing something similar. Upgraded from 10.7 to 10.25.0 and started seeing jerky scrolling. This is with a horizontal paged scroll view and some writes occurring during paging. Downgraded to 10.16.0 (just picked a version in the middle) and the issue is gone. I'm using Carthage. Just a realm database, no sync. |
Hi @timothycosta can you show us your code for the view, how many items are you loading on the view? |
@dianaafanador3 Unfortunately not really without giving access to the entire project. It's not simple like a single tableview or something. Something like 25~100 items get written at a time though. I would have liked to narrow it down to a specific version realm version also, but each Carthage build takes ~15 minutes and I don't have the time for it atm. |
@timothycosta are you performing the writes on the main thread?, sometimes bulk writes may block the UI thread and provoke UI performance issues, we are gonna release shortly a feature which allows to write asynchronously to the realm without blocking the calling thread. Also, is worth mentioning that we are working on having better write performance to the realm in future releases. |
@dianaafanador3 Yes, they are on the main thread. I've recorded this trace in Instruments for v. 10.25.0. Start from about 15s. I'll be away for the next week, so won't be able to provide more than this for now. |
@dianaafanador3 I went through the releases here and found that 10.21.0 is the last version that I can use. From 10.22.0 on I get unacceptable hitches in our app. Hope that helps. |
Hi @timothycosta thanks for the info, this surely will help to get to the source of this issue. |
We're seeing the same problem in realm/realm-js#4383, and we're thinking that our issues with Realm in React Native is tied to this issue. For us the problem started in realm-js-v10.12.0, and in this issue, the problem seems to have started with realm-swift-v10.21.1. The common change in both releases that started this performance issue is this:
It seems to me that Realm Core 11.8.0 could be the culprit. Update: Another thread where 10.21.1 looks like the culprit for react-swift: https://www.mongodb.com/community/forums/t/swiftui-slow-loading-views/147346/12?u=adam_gerthel |
Possibly related to #7743 since it seems as if they're suggesting that versions prior to realm-swift-v10.21.1 do not have the performance issue. |
I can confirm that the issue raised in #7743 is not present in RealmSwift v10.21.0 and is present in v10.21.1. |
v10.27.0 partially fixes this, and in the most extreme cases is ~10x faster than v10.26.0. It will still be slower than v10.21.0 as the root cause of the slowdown is a fix for potential data corruption if a device powers off at exact the wrong point in committing a write transaction, and we're trying to keep that fix. If 10.27.0's write performance is still a problem, using async commits may be a good solution. |
➤ Lee Maguire commented: As per last comment, from 10.27.0 onwards is 10x faster and async writes are now available. |
How frequently does the bug occur?
Sometimes
Description
I am using RealmSwift 10.7.4 before,
After update to 10.24.2 I notice the difference speed (slow) in writing transaction
Stacktrace & log output
I am using RealmSwift 10.7.4 before, After update to 10.24.2 I notice the difference speed (slow) in writing transaction
Can you reproduce the bug?
Yes, sometimes
Reproduction Steps
Start writing 200 transactions to Realm database
Version
10.24.2
What SDK flavour are you using?
Local Database only
Are you using encryption?
Yes, using encryption
Platform OS and version(s)
RealmSwift
Build environment
Xcode version: 13.3
Dependency manager and version: Cocoapods
The text was updated successfully, but these errors were encountered: