Hey guys,
While using realm for RN Android, I'm trying to write/update around 50 of objects like:
realm.write(() => {
results.forEach(function (dict, i) {
realm.create('MyObj', {
pk: dict.pk,
someProp: dict.someProp
})
})
})
Without debugging in chrome it's lightning fast, but when I debug in chrome, it takes around half a second to write each object, blocking the UI, and rendering the app completely unresponsive for over 20 seconds. Any idea of why this is?
+1, in RN IOS chrome debugger also extremely slow...
@MichaelDanielTom Are you debugging on device or on an emulator? The Realm API is synchronous, which means we need to use synchronous HTTP requests under the hood for Chrome debug mode. This inherently makes it much slower in debug mode. I've observed it being much faster on the iOS simulator than through an Android emulator due to the emulator using a virtual network interface through a VM. However, it will be slowest when debugging on device, which is why I ask.
@appden I'm using a genymotion emulator with a Nexus 6 if that matters :/
@MichaelDanielTom Thanks. I made some performance improvements in a PR (#407) that will be merged before the next release. I'll take a look to see how much impact that actually had with Android.
@MichaelDanielTom We just released 0.12.0-rc. We'd would really appreciate if you tried it out and let us know if you noticed any performance gains. It still will be _much_ slower in Chrome debug mode, but hopefully less unacceptably slow. :smile:
@appden Thanks!!!!! I'll check it out tonight and let you know :)
@appden It's a little better, but at this stage in my app's development (I'm making the android version of Radiate) There seems to be too much data for chrome debugging to be a feasible option, without significant dev setup :/ as in there are just a ton of background fetches that are saving to realm during normal app navigation.
On an unrelated note, I want to find other people who are developing apps with react-native, and Realm who just wanna talk through stuff, what do you think the best way of doing that is? Is there a slack channel or something? If not I'd be down to start one.
@MichaelDanielTom we don鈥檛 have an official Slack channel no, I think a few popular slacks for iOS/Android/reactive apps have a Realm channel of some sort that you can use.
We are tracking this in #206
It also happens on IOS Simulator
I use chrome dev tools only for showing console.log() output. I've found that Mac OS console logging tool is working with Realm much more faster. Use $ react-native log-ios or $ react-native log-android in your terminal. https://facebook.github.io/react-native/docs/debugging.html#accessing-console-logs
Most helpful comment
I use chrome dev tools only for showing
console.log()output. I've found that Mac OS console logging tool is working with Realm much more faster. Use$ react-native log-iosor$ react-native log-androidin your terminal. https://facebook.github.io/react-native/docs/debugging.html#accessing-console-logs