So FB mixes this and react native in their app?
Multithreaded rendering on Android
11–20 of 22 posts
Re: Multithreaded rendering on Android
#12What they're talking about doing here is multi-threaded layout which isn't nearly that impressive. Heck, you can call measure()/layout() off-thread right now on views, there's just an invalidate when they get inserted into the hierarchy.
Also something not mentioned is that each CPU core you spin up is eating into XX% of your battery life. So you may get a faster layout but your users may see worse battery usage because of it.
[1] - https://android.googlesource.com/platform/frameworks/base/+/...
Re: Multithreaded rendering on Android
#13Erm, android already does multi-threaded rendering via HWUI[1] at the Canvas level. What they're talking about doing here is multi-threaded layout which isn't nearly that impressive. Heck, you can call measure()/layout() off-thread right now on views, there's just an invalidate when they get inserted into the hierarchy. Also something not mentioned is that each CPU core you spin up is eating into XX% of your battery…
Re: Multithreaded rendering on Android
#14Erm, android already does multi-threaded rendering via HWUI[1] at the Canvas level. What they're talking about doing here is multi-threaded layout which isn't nearly that impressive. Heck, you can call measure()/layout() off-thread right now on views, there's just an invalidate when they get inserted into the hierarchy. Also something not mentioned is that each CPU core you spin up is eating into XX% of your battery…
That is not correct. There is only one HWUI render thread per app. HWUI doesn't use multithreaded rendering. You can verify this easily running "ps -t".
For what it's worth unless you're on Vulkan(which few Android devices support) you're going to be limited to a single dispatch thread by GLES' threading semantics anyway.
I still rest my point that they're doing layout, which is fine but doesn't consist of multi-threaded rendering. Using their approach they're still going to have to set some sort of absolute layout views which must go through a measure and layout pass on the UI thread.
Re: Multithreaded rendering on Android
#15Erm, android already does multi-threaded rendering via HWUI[1] at the Canvas level. What they're talking about doing here is multi-threaded layout which isn't nearly that impressive. Heck, you can call measure()/layout() off-thread right now on views, there's just an invalidate when they get inserted into the hierarchy. Also something not mentioned is that each CPU core you spin up is eating into XX% of your battery…
That is not correct. There is only one HWUI render thread per app. HWUI doesn't use multithreaded rendering. You can verify this easily running "ps -t".
Re: Multithreaded rendering on Android
#16Erm, android already does multi-threaded rendering via HWUI[1] at the Canvas level. What they're talking about doing here is multi-threaded layout which isn't nearly that impressive. Heck, you can call measure()/layout() off-thread right now on views, there's just an invalidate when they get inserted into the hierarchy. Also something not mentioned is that each CPU core you spin up is eating into XX% of your battery…
It is telling that battery life is almost never mentioned or discussed in depth anywhere. What is the battery impact of React Native? Or of this solution?
Re: Multithreaded rendering on Android
#17Erm, android already does multi-threaded rendering via HWUI[1] at the Canvas level. What they're talking about doing here is multi-threaded layout which isn't nearly that impressive. Heck, you can call measure()/layout() off-thread right now on views, there's just an invalidate when they get inserted into the hierarchy. Also something not mentioned is that each CPU core you spin up is eating into XX% of your battery…
Indeed, moving to multiple cores is about doing more work faster which has a direct impact on battery life. You'd have to measure whether this allows you to race-to-sleep faster or not which is a delicate balancing act. It is telling that battery life is almost never mentioned or discussed in depth anywhere. What is the battery impact of React Native? Or of this solution?
It's a really nasty problem too because power usage isn't linear. Chips tend to have voltage steps[1] as they increase in frequency so if you can do something longer and at lower frequency it uses less power than the same workload at a higher frequency for shorter time.
Compound that with the fact that you really want to bring the whole SoC to a low power state and just keep the display lit since 90% of the time users aren't actually moving something.
Arm has tried to solve this with big.LITTLE[2] to mixed results. It turns out that it's hard to build a general purpose scheduler that's power aware much like it's hard to build a general purpose memory allocator that's fast in every case.
Re: Multithreaded rendering on Android
#18Re: Multithreaded rendering on Android
#19Are there any examples of how to convert an existing project to Litho ?
Re: Multithreaded rendering on Android
#20Also android developers are using Reactive components more and more, but the UI is still very much statefull. So i see a bright future for this approach (maybe not the facebook library, but the approach itself)