-
Notifications
You must be signed in to change notification settings - Fork 582
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
Chrome debug mode is Extremely slow #491
Comments
+1 |
1 similar comment
+1 |
We know android is very slow. We have seen RPC roundtrip times on the order of ~40ms per operation which would slow things down to a halt for complex apps. Things on iOS should be up to a few orders of magnitude faster though. |
It is extremely slow on iOS. |
@CodeTitanian Are you seeing this on device or in the iOS simulator as well? Can you report what the response times look like for the rpc requests by looking at the Network tab in the Web Inspector? I see them averaging around 1ms. |
A Probably the best you can do to minimize these calls is to cache any information that is reused. Beyond that I'm not sure what else you can do easily. There are internal changes we could make to minimize some of these calls - we may be able to cache some property values internally and possibly even cache object properties or preemptively batch fetch some data. For the cases where performance issues are caused by looping through a set of objects these optimizations could possibly speed things up 2x-5x or more at the cost of added complexity. I'm not sure if this would be enough of a speedup to resolve the issues you guys are seeing. The other alternative would be re-architect the way we do chrome debugging to do more work in js rather than forwarding all operations over rpc to the core Realm implementation. This would be considerable more work but may be necessary if the optimizations mentioned above are not sufficient. It isn't clear if this will be worth the effort as it seems that ReactNative will be moving away from chrome debugging to other alternatives. |
It's definitely significantly slower on Android simulators than iOS. I suspect the issue on Android may either be from overhead with the virtual machine networking stack or the passing everything through the JNI. |
There should be a note about this behaviour in the documentation. I was making research about using a different mobile database for next project in my company. I almost totally ditched realm react native because I was measuring performance by |
@krzkaczor - we will definitely add this. |
Wish I had something more constructive to add here other than to say that performance in the chrome debugger is (at least in the short term) making it hard to adopt it. For example: I have a scene that lists 50 U.S. states and a set of stats for each. This represents two 'queries': one to get all the states and another to get all the stats. The result sets are dumped into a redux store and are then connected to the scene component. The scene component implements a ListView that renders the states. In the debugger loading the scene results in 6776 get_property requests for a total request time of around 40 seconds. Without the debugger the scene takes around 500ms to fully render (using the scientific "One One-Thousand" measuring technique) In the release build the scene loads basically instantaneously (probably around 50ms) So, the 'real-life' performance of Realm has exceeded my expectations and the API hasn't been too hard to get use to, but the fact that my complex scenes are now virtually un-debuggable means I'm not sure I can stomach it even though it will deliver the best experience to the user. I'm happy to provide whatever help or experience I can to improve this because the end-result would be a fast, stable db. Note: I'm experimenting with replacing |
Thanks @cpsubrian for the detailed use case. It's clear that chrome debugging performance is subpar and needs to be improved. The good news is that we should be able to speed things up considerably and just need to find the time to put the work in. I detailed some of the caching and batch-fetch optimizations we could make here #491 (comment) - will try to bump of the priority of working on this and will try to knock off some of the low hanging optimizations sooner rather than later. In the meantime if you want to have a crack at making some of these improvements 'm happy to help you get started. |
how to solve the problems, many get_properties when I use Chrome Debug react native realm??? |
Is it possible to turn off debugging only for Realm? It could be a workaround for this problem because I don't really need to debug Realm Network calls and things like that. ;) |
I wonder how anyone can possibly use Realm since Chrome debugging is essential for developing a React native app... |
Any advancement in regard to this issue |
Any update on this? This is critical for me, as I've got a pretty complex app with multiple Schemas (i have more than 30000 requests to get_property, it's been 25 minutes and I can't even start the app to debug it properly...) |
I use chrome dev tools only for showing |
I found that when keeping the chrome tab active and visible, the speed is normal. When the chrome tab is not active or hidden by an application running in the foreground it slows down. |
Any updates on this issue? I have the same issue, debugging is really a pain, why does realm make so many rpc calls for get_property? |
Any news on the issue? |
@invibot, sorry, not at this point. I will keep this issue updated when I make some progress. |
I'm using reactotron debugger for fast debugging. See their Tips & Tricks so you can ditch Hope this helps. |
Hi guys! I started a project using Realm as the database engine. When I faced the debugging issue sadly I had to move to another one. After v2.28.0 is it any better? Could anyone give some feedback? Thanks in advance |
I have use the 2.28.0, it has some improvement but still unbearable for my case. |
@cheansiong For future work, it would be great if you can provide some context - for example how large is your data set? |
@kneth It has two object type, eg: Setting, AppObject
AppObject
Notes: Hopes this helps. :) |
Hey guys, just wanted to let you know that I wanted to give another try to Realm. Last time I tried I was using 2.6.x. I installed 3.0.0-beta.1 and in my opinion the debugging experience is better. Right now the database has something like 1000 records across 6 different tables. |
Yes, I agrees that it is significantly better. However, I think the performance is still not usable for scenarios where reading / writing about 200-300 objects at one point is required. My test scenario is each object has about 20-30 properties. |
@cheansiong In our case we are writing 500 objects at once and still performing good. It's also true that when we do so the db is empty, I don't know if that may affect. |
Version |
I was experiencing slow debugging as well when starting to use realm-js with react-native. I was just using a single schema with 2 fields, empty db. Nevertheless, a simple transaction to a single object property froze the UI for 1 or 2 seconds. Without debugging the performance was great though. I was pretty must ready to give up on using realm-js because of this. However, I was using the debugger from Visual Studio Code. When I switched to the Chrome debugger the performance was acceptable / good. It's not completely related to this issue but it might help people experiencing a similar issue when using Visual Studio Code's debugger.
|
That is a nice tip @mattijsf . Thanks for sharing! |
Decided to give a try to realm with react native as it looked like it could help our offline storage to become more maintainable and "jimmy proof" rather than our custom file namming. The use case is : storing timeseries (datetime + up to three value) shown to the user for each day for 3 variables at the same time. I really liked the way realm integrates with react native (migrations, schema, queries etc..) but that's definitely a blocker for us. |
Wow - after a long thread, this comes to an abrupt stop at the end of 2019. Was there some resolution? After some research (tho sadly not seeing these threads) I replaced large chunks of my app's redux-persist with realm due to the many hundreds of items I'm sifting through. The promise of realm is great, but my debugger implodes when I first write all the objects. I am on the latest version, so I wonder why this conversation has ceased... (I see the merge above, but I've been reading for over two hours now, and it is way past my bedtime, so may have to check that out tomorrow) |
The support of the Chrome debugger was removed in version 11.0.0 and we ask you to use Hermes and Flipper. |
When chrome debugger is attached realm is extremely slow! makes it unusable for development
Happens both on IOS Simulator / Android Emulator
The text was updated successfully, but these errors were encountered: