Iterative Write Operations Cause Significant Delays and UI Freezes
I am encountering a performance issue with iterative write operations in Realm DB. My application involves calling APIs and iteratively storing the fetched data in Realm. This process had been working seamlessly for past years.
However, after upgrading both the app and Realm DB to version 20.1.0, the performance has degraded significantly. Previously, the entire operation would complete in approximately 3–4 minutes, but now it takes around 20 minutes. Additionally, during the data storage process, the app experiences severe freezing, making it unresponsive.
I have already tried various approaches, including batch write operations, adding timeouts to reduce UI blocking, and utilizing requestAnimationFrame. Unfortunately, none of these measures have resolved the issue.
I would appreciate any guidance or suggestions to address this performance regression and UI freeze.
React Native Info
System:
OS: Windows 10 10.0.19045
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz
Memory: 389.11 MB / 7.40 GB
Binaries:
Node: 20.14.0 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
Android NDK: 22.1.7171670
Windows SDK: Not Found
IDEs:
Android Studio: AI-221.6008.13.2211.9619390
Visual Studio: Not Found
Languages:
Java: 17.0.12
npmPackages:
@react-native-community/cli: ^9.3.5 => 9.3.5
react: 18.2.0 => 18.2.0
react-native: 0.71.19 => 0.71.19