I am using react-native 0.52.0 and react- 16.2.0 . My react-native application runs slowly. I want to optimize its performance. Can anyone tell me what are the ways in which we can make react native app faster and how to measure its performance and memory usage? Is there any tool to measure its overall performance
1) (reactotron) https://github.com/infinitered/reactotron
It streams to you information about your app’s state, API calls, benchmarks, exceptions, and other stuff.
2) https://facebook.github.io/react-native/docs/performance.html
This page contains all you need to check for performance in the app.
You can use Android Studio Profiler to monitor memory usage on Android. Take into account that you will need Android 10 for the profileable tag in Android Manifest to work.
Related
Platform Unity 2019.4.8.f1
Apk tested on Android devices
Api lvl 21+
Test failure on some devices that have 2gb memory.
Our team has implemented a unity project and we use agora for video call. Our streaming configs are very low, 15fps, 65bit. But when we test the app on phones that have 2gb memory, some times later(about 5-10min) app crashes. We try to find out the problem and according to diagnostic tools agora uses lots of memory, We cannot find any limitation from agora sdk and cannot reduce memory usage, is there any idea about this. Thanks.
First, did you make sure if this is an Application level memory management issue? e.g., you created instance of renderers but did not release in time?
If it is SDK level issue, you probably won't find a solution from the public. I suggest you to create a ticket to ask the question directly to the Agora support team. Please provide your quantified analysis and the crash log when you submit that.
I'm developing a react native application. I have just realized that the application memory usage is growing, even when I'm not touching the app. If I navigate between screens I see that memory usage is growing much faster.
I have got some memory snapshots in Safari web inspector but I do not know how to use this information.
Can you please give me some hints? I have found out that this may be some react native navigation issue.
Versions:
"react-native": "0.59.9",
"react-navigation": "^3.11.1",
Memory usage chart
Memeory snapshot comaprison
I need to measure the performance of a React Native app. What's the best tool for this?
I try google trace in google chrome, and Instruments in mac for iOS platform, but these show me a lot of unorganized data.
I implemented some tools that helped me to check my application's performance, below is the list of the tools:
1) (reactotron) https://github.com/infinitered/reactotron
It's the coolest way to get logs of your application(redux actions etc), I have integrated this tool in my projects, in case you need any help just feel free to ask.
2) https://facebook.github.io/react/docs/perf.html (react-addons-perf)
This tool tells you about the frames/s,instances etc.. This is a react tool, it possible to integrate with react native.
Use the built-in Profiler to get detailed information about work done
in the JavaScript thread and main thread side-by-side.
For iOS, Instruments are an invaluable tool, and on Android you should
learn to use systrace.
You can also use react-addons-perf to get insights into where React is
spending time when rendering your components.
Another way to profile JavaScript is to use the Chrome profiler while
debugging. This won't give you accurate results as the code is running
in Chrome but will give you a general idea of where bottlenecks might
be.
Note: The above tools are for monitoring javascript performance, for example time took to rendering of components, which action in redux is getting inbetween the flow of regular actions..
Cheers :)
I am trying to evaluate whether Xamarin would be a good option for my project. The project is a large, complex app for Android and iOS with a lot of client-server communication. The user interface is a major focus and has to be really fast and smooth. Also, we plan to make large use of UX graphic effects (comparable to the Spotify app).
For now we are planning to go for two separate native apps using Java/Objective-C. However, the possibility of cross-platform code sharing would be very convenient for us of course.
Most opinions I've heard so far say that Xamarin - although far better than HTML5 apps - cannot match the UX of a native app. Also, I tested the following applications made with Xamarin (on Android):
Rdio
MarketWatch
Busch Gardens Discovery Guide
Sqor
Storyo
From my impression, none of them could quite match the speed and smoothness of a good native app.
If our focus is on a top notch user experience, would Xamarin really be a viable option? Can it really match a native UX? I am particularly looking for opinions from developers who have experience with large and complex cross-platform Xamarin applications. A few critical voices would be very helpful.
Thank you a lot!
I'm on the Rdio mobile development team, so I can make some personal reflections from that standpoint.
Xamarin allows you to write native applications in C#. Any slowness, jankiness, ugliness or bad-appiness usually has nothing to do with the Xamarin layer itself.
You save some time being able to share core business logic between your different clients, but you're still writing the UI from scratch, specific to the platform. You're just writing it in C#.
But while you save that time, you're spending it in other ways. All of those SDKs you want to use probably aren't compatible with Xamarin out of the box. You won't be pod install'ing that iOS framework, and you might be reinventing the wheel for handfuls of things. Xamarin takes advantage of the NuGet repo so you have a library of components that handle many of the things most people need (Analytics, Testing, Facebook SDK, JSON parsing, Database, etc etc) but it doesn't cover everything. And it certainly doesn't cover stuff that's out the day of an Apple or Google product announcement.
Any 3rd party code that you do want to import into your project will be done through writing custom bindings. While not usually difficult, it is time consuming. Xamarin has a team of people that specialize in assisting you in this. This fact speaks to the process being messy at times.
So while the slowness, jankiness, ugliness or bad-appiness probably isn't the fault of Xamarin, it might be the fault of you spending time in places you normally wouldn't, or not being able to take advantage of features you normally would. If that 3rd party partner SDK is giving you problems, your troubleshooting may take twice as long because there's a layer that you don't control.
UI is a wash. You're writing it from scratch anyway.
Business logic is shared. Depending on the app that might be a win if you architect your application to take advantage of it.
Compatibility / bleeding edge ability will be lacking. That might not matter to you at all, or you might be the person wanting to take advantage of that hot new API in the next OS release the day it's announced.
My personal thought, without knowing specifics, is if you want to build an application that you plan on being around years from now, and that will take advantage of the latest and greatest, I'd tell you to write natively for each platform. Unless you can really see huge gains in sharing that business logic the upfront gains are minimal. Or if you really like C#.
Xamarin uses native controls. So you design a fully native UI per platform. The users can't see that your App is made with Xamarin or Java/Objective-C.
There are sometimes performance issues in conjunction with the platform independent UI wrapper Xamarin.Forms. But you're not forced to use it. When you have still performance issues in your Xamarin.Android or Xamarin.iOS app then you produce them in your code.
There are benchmark results for Android apps comparing Xamarin.Android and Java apps: Does anyone have benchmarks (code & results) comparing performance of Android apps written in Xamarin C# and Java?
As you can see Xamarin's internal performance became better and better over the time.
Conclusion: Yes, you can write smooth native Apps using Xamarin.
I'm a tester and our company is planning to build an app in HTML5/CSS/JS, jquery mobile and deploy on iPhone and android using phonegap.
I was wondering how would I test performance of the app on these platforms? Specifically performance of the rendering, user response times, dynamic data binding?
Is there a tool that can measure performance of the above? Can I use automation?
Appreciate your answers.
You can use Weinre. But the metrics are limited and still a lot of manual steps involved. Your best bet is to write your own instrumentation and JS based reporting.