Skip to content
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

Updates on extremely slow and clog main thread with React-Native Android using chrome debugger #390

Closed
MichaelDanielTom opened this issue Apr 16, 2016 · 11 comments

Comments

@MichaelDanielTom
Copy link

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?

@helloworld123456
Copy link

+1, in RN IOS chrome debugger also extremely slow...

@appden
Copy link
Contributor

appden commented Apr 26, 2016

@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.

@MichaelDanielTom
Copy link
Author

@appden I'm using a genymotion emulator with a Nexus 6 if that matters :/

@appden
Copy link
Contributor

appden commented May 1, 2016

@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.

@appden
Copy link
Contributor

appden commented May 3, 2016

@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. 😄

@MichaelDanielTom
Copy link
Author

@appden Thanks!!!!! I'll check it out tonight and let you know :)

@MichaelDanielTom
Copy link
Author

@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.

@timanglade
Copy link
Contributor

@MichaelDanielTom we don’t 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.

@alazier
Copy link
Contributor

alazier commented May 31, 2016

We are tracking this in #206

@anativ
Copy link

anativ commented Jun 14, 2016

It also happens on IOS Simulator

@nulleof
Copy link

nulleof commented Sep 10, 2016

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants