Comments (6)
➤ PM Bot commented:
Jira ticket: RCOCOA-2306
from realm-swift.
Do you think you can get the Realm file that reproduces the issue and either share it with us or get a profile to help us understand where the app is spending time? As a temporary workaround you could try shipping a version that doesn't compact the Realm file at launch.
@finnschiermer this is updating from Core 13.20.1 to 13.26.0 - I tried skimming through the changelog entries and there was nothing that jumped at me as having potentially large performance impact.
from realm-swift.
As a temporary workaround you could try shipping a version that doesn't compact the Realm file at launch.
How do you do this? Will the realm never be compacted, or just not while it's being opened?
Do you think you can get the Realm file that reproduces the issue and either share it with us or get a profile to help us understand where the app is spending time?
I won't be able to get the exact realm file. We'll likely need to see whether we can create one artificially.
from realm-swift.
You can return false
in the shouldCompactOnLaunch
callback skipping compaction for the Realm file. You can also use a heuristic where it returns true
for smaller files, but not for those large ones, which take a long time.
In terms of whether the file it'll compact, the answer is yes-ish. By that, I mean, that we now have automatic compaction enabled on every commit where we'll do certain cheap storage optimizations continuously. This is not as effective as running a compact on launch but it gets close in a lot of scenarios.
Alternatively, you could restructure your app so that it doesn't open the Realm file as part of the AppDelegate.application
call and instead do it after that the app has loaded (possibly adding a loading indicator in case the file size is beyond a certain threshold).
from realm-swift.
Ok, I spoke with @finnschiermer and there's nothing obvious that would cause significant performance degradation between these versions of Core. It's possible that this was already fairly slow and a small write performance regression just pushed it over the 17 seconds limit. If you can provide a repro case, we can run a profile and try to see what's taking more time now.
That being said, compacting such a large file on app initialization would be a bad idea, regardless of the version of the SDK as it would require write speeds of >270 MB/s in the worst case scenario to fit in under 17s, and even then it would be a bad user experience to stare at a blank screen for so long. As suggested above, one approach would be disable compact on launch for files above a certain threshold or if you need to run it, you should try and open the Realm on a background thread after the app has finished initializing, then after that has succeeded, open it on the main thread.
from realm-swift.
Related Issues (20)
- @AutoOpen doesn't work HOT 1
- Repeative Crash HOT 9
- Crash when launch HOT 9
- Crash with in query when comparing with empty collection
- Sectioned Results with Empty Sections HOT 5
- Realm-swift is utilising 100-150% CPU when in background HOT 3
- Crashed: Realm Notification Listener (BACKGROUND) HOT 9
- Error InvalidSession on logout after delete user HOT 7
- Crash - Assertion failed: m_lock_info && m_lock_info->m_file.get_path() == m_filename HOT 5
- Crash in Realm Sync, realm::SyncSession::handle_location_update_failed, realm_core_v_13_26_0 HOT 11
- Building with cocoapods produces warning about duplicate libraries - "-lc++" HOT 1
- realm-monorepo.xcframework & required reason API usage HOT 2
- Update default base URL to new domain HOT 1
- "Decryption failed" errors immediately after compacting two Realm files on startup HOT 6
- Create a GHA workflow to upload core prebuilds to S3 HOT 1
- Swift UI Previews are crashing in Xcode 15.3 (worked fine in 15.2). HOT 6
- Crash when user sessions are revoked HOT 3
- Use type-safe keyPath modify object HOT 1
- Expose an API that allows merging collections rather than replacing them HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from realm-swift.