Live data from Hacker News

Lottie 4.0 for iOS: new render engine with significant performance improvements

medium.com

71–80 of 127 posts

Re: Lottie 4.0 for iOS: new render engine with significant performance improvements

#71
post #58

Earlier quoted context omitted.

You’re ignoring the OS doing other things as well before letting you draw to the screen. This isn’t a video game where they’re direct drawing to a graphics context with exclusive use of the resources. They’re also setting up native widgets in the background, coordinating data downloads etc.. Unlike a video game where you control the rendering and scheduling to a greater degree, here they’re beholden to when the OS de…

Interesting. Are videogames not beholden to the OS? Are all background processes suspended when SDL is running? Clearly videogames don't have native widgets in the background, nor do they ever "coordinate data downloads" (????) What an absolutely braindead reply. A telltale sign a comment has almost no thought put into it: when you go into the user's post history and see the first page filled with comments written th…

The irony that you’re the one who’s getting worked up about someone else’s internet activity while acting like I’m the one that needs more reality. You’re right your advice is unsolicited, so please kindly keep your issues to yourself.

I’d have been happy to discuss the nature of a UIKit and iOS based app cycle that affects these things, but I won’t with such an insufferable person who has nothing better to do than to contribute nothing other than their own anger out to the world.

I find topics interesting. I comment on said topics. That’s all that matters. Not your opinions. Not your weird hang ups.

It’s the holiday season. Go find someone to love you or share joy with instead of finding people to hate on on the internet. You clearly need it if this is the kind of stuff that gets you raging.

Re: Lottie 4.0 for iOS: new render engine with significant performance improvements

#72
post #58
post #13

> These issues are inherent limitations of using a main-thread-bound rendering architecture. sorry but bullshit! Sure, multi-threaded rendering can give faster results but the apps AirBnB is making could have easily rendered at 60hz with single threaded software rendering in flash in 1998! I can only guess that too much abstraction throughout the systems has turned into death by 1000 cuts and their solution, instead…

You’re ignoring the OS doing other things as well before letting you draw to the screen. This isn’t a video game where they’re direct drawing to a graphics context with exclusive use of the resources. They’re also setting up native widgets in the background, coordinating data downloads etc.. Unlike a video game where you control the rendering and scheduling to a greater degree, here they’re beholden to when the OS de…

I do feel like video games definitely have it harder on this front in general, but tend to have loads of people focused on performance "at all costs", including generating a bunch of messy code to get something shippable.

I also think saying that a retained mode UI has inherent overhead is a bit odd. immediate mode UIs have to rebuild their entire draw graph on each frame! meanwhile retained mode UIs have a bunch of metadata letting them get nice optimization improvements. Translating an object means you might not even need to redraw it!

There is definitely a certain truth to the OS being able to just force you down to a lower priority, but I think we all know that iOS is pushing the top app to as high a priority as possible. Meanwhile the "inherent difficulties" with something like AirBnB (getting data over the wire) are definitely inherent but this is why we talk about placeholders and stuff like that yeah?

But if you're in the business of selling rentals it's hard to have so many engineers focused on the performance of the app (especially when you are in the act of being successful already)

Re: Lottie 4.0 for iOS: new render engine with significant performance improvements

#73
post #72
post #58

Earlier quoted context omitted.

You’re ignoring the OS doing other things as well before letting you draw to the screen. This isn’t a video game where they’re direct drawing to a graphics context with exclusive use of the resources. They’re also setting up native widgets in the background, coordinating data downloads etc.. Unlike a video game where you control the rendering and scheduling to a greater degree, here they’re beholden to when the OS de…

I do feel like video games definitely have it harder on this front in general, but tend to have loads of people focused on performance "at all costs", including generating a bunch of messy code to get something shippable. I also think saying that a retained mode UI has inherent overhead is a bit odd. immediate mode UIs have to rebuild their entire draw graph on each frame! meanwhile retained mode UIs have a bunch of…

With regards to retained mode overhead, I mean it across multiple forms not just the cost to redraw.

There’s the overhead of pushing updates to the UI layer from your app code, having it trigger an update, which in turn makes it check what other things have updated and what needs to redraw. UIKit is handling all that for you, but as a result you’re not getting full control of when you’re updating. You get pacing issues, where you can’t really guarantee you’re drawing at set intervals either which can lead to pacing stutters since you’re beholden to the apps event loop.

With an immediate mode UI in a game, yes there’s more cost to set up your draws, but you have more direct control of when everything will update because you’re handling the event loop more directly.

As for other priorities, I don’t mean just app priority. I mean intra-app priority. Lottie has to mix in with user code, the app it’s within might schedule a task with a higher QoS priority. It’s not just showing a fixed animation, it’s part of the app interaction model. So it’s easy to get into a situation where the rest of the app introduces stutters inadvertently.

Using CoreAnimation lets you sort of side step that discussion.

And yes I agree games have it harder over all because they have to handle everything. That wasn’t my point really. I think though that games have it easier when it comes to frame timing as a result of being able to control the entire event loop. So it’s easier for a game to reason about and guarantee smoothness of motion than it is for a framework that has to fit into arbitrary applications.

Re: Lottie 4.0 for iOS: new render engine with significant performance improvements

#74
post #70

Earlier quoted context omitted.

GPUs have no concept of animation. A frame rendered by a GPU has a fixed state, usually computed on the CPU. Until recently, this was usually done on the main thread, because graphics APIs had poor support for being used from multiple threads. I have no idea what AirBNB was doing to fail 60Hz on rather simple scenes with a single thread, but you can rest assured that it is possible without multiple threads or even pr…

The point is that iOS has always used a separate process for computing the GPU state. Android does this on the main thread, which is why Android feels like garbage. And I say this as a former Android developer. Animations on Android feel like peanut butter. They always will until they are moved off the main thread.

That's not technically correct(which is always the best kind of correct :) ), HWUI has been multithreaded for quite a long while now. That doesn't prevent apps from doing bad things but it's been possible to do smooth animation on Android since the days of project butter.

Re: Lottie 4.0 for iOS: new render engine with significant performance improvements

#75
post #70

Earlier quoted context omitted.

The point is that iOS has always used a separate process for computing the GPU state. Android does this on the main thread, which is why Android feels like garbage. And I say this as a former Android developer. Animations on Android feel like peanut butter. They always will until they are moved off the main thread.

That's not technically correct(which is always the best kind of correct :) ), HWUI has been multithreaded for quite a long while now. That doesn't prevent apps from doing bad things but it's been possible to do smooth animation on Android since the days of project butter.

How do you animate on the HWUI thread?

Re: Lottie 4.0 for iOS: new render engine with significant performance improvements

#77

Earlier quoted context omitted.

Are you on iOS Developer? Anything related to UI is always suggested to be done on the main thread by Apple.

No. Animations are usually performed by the GPU under the control of a separate process. "This system framework renders animations out-of-process with GPU hardware acceleration. Animation playback is managed by a separate system process called the “render server”. " This was actually a really cool trick that was in-place from day 1 and the main reason iOS animations were smooth on fairly anaemic hardware. And smoothe…

On iOS, you schedule animations (and all UI updates, period) on the main thread. iOS is then free to make those happen in a non blocking way. iOS dev 101 is “don't do long synchronous work on the main thread because your app will lose the ability to update its UI for the duration”

Re: Lottie 4.0 for iOS: new render engine with significant performance improvements

#78
post #5

Earlier quoted context omitted.

Are you on iOS Developer? Anything related to UI is always suggested to be done on the main thread by Apple.

Suggested? It's required, otherwise behavior is undefined for many APIs. And with the main thread checker you now also get runtime issues when you access such APIs. It's more shocking to me that Apple hasn't explicitly shifted at least some of its UI frameworks off the main queue in the last 15 years, especially as they've added tools to make it easier. Of course, given the bugs with the parts that are off the main q…

ComponentKit for Facebook was explicitly built to offload as much ui work as possible to other threads (text sizing being super expensive) and only go back to main to say “here is your new react style model”.

I was very surprised that SwiftUI didn’t do this too.

Re: Lottie 4.0 for iOS: new render engine with significant performance improvements

#80
I've only heard of lottie but never really used it so I'm slightly confused with this.

Were these issues present only in the iOS version of the library? or are these issues present across android, web, and RN as well? and will these platforms also get the upgrade?

Post reply on HN