Re:Show HN: React Native scrollable bottom sheet native anim...
by LeoNatan25 on Saturday May 23, 2020 @12:50PM
(#23284428)
The overhead is much, much lower in native development. Having a JS bloatware adds a lot of slowdown, as does the additional nonsense layers of React Native itself. As you can see, RN developers are still boasting “60fps animations” in 2020.
Re:Show HN: React Native scrollable bottom sheet native anim...
by Pulcinella on Saturday May 23, 2020 @03:08PM
(#23285518)
Also I believe the traditional drawing algorithm (e.g. the painters algorithm) is not well suited for parallelization and how gpus do work. So the gpu is “fast” at slapping a circle texture on a couple of triangles, but rendering a circle from vector data not so much.
I think Apple has said that Core Animation (and maybe Core Graphics) now use Metal where possible, but vector to bitmap rendering is still done on the cpu.
https://raphlinus.github.io/rust/graphics/gpu/2019/05/08/mod...
Re:Show HN: React Native scrollable bottom sheet native anim...
by izacus on Saturday May 23, 2020 @03:40PM
(#23285737)
Native framework (I'm familiar with Android) will just issue a translation coordinate change for the rendered view in this scroll. So there's no CPU <--> GPU transmission here because the view is already rendered in a texture and compositor will just move it a bit.
If web frameworks really reupload the whole view to GPU on each frame, it's no wonder all apps run like arse and burn battery.
Re:Show HN: React Native scrollable bottom sheet native anim...
by kall on Saturday May 23, 2020 @04:20PM
(#23286033)
They don‘t, but you also can‘t prepare (and download) a whole list of (tens of) thousands of items, which is why you only do the parts that are going to be scrolled in next. Both react native and standard native apps do this, but standard native apps are much better at it.
More and more gets ported to the GPU through parallelized algorithms, and smart GPU memory usage — but CPUs still offer a lot in their ability to do generalized computing.
This is why as I’ve gotten older I’ve come to really respect Computer Science fundamentals; the more you understand how to make the most of resource constraints — whether time, or memory, etc — the more magic you can make.