xilem icon indicating copy to clipboard operation
xilem copied to clipboard

FPS drops in scroll example

Open leontepe opened this issue 3 years ago • 5 comments

See here:

https://user-images.githubusercontent.com/27787342/202433627-bf1ace81-6270-49df-9b36-8f013b5c2dfb.mov

Running on M1 Mac in release mode.

What's the performance bottleneck here? How can this be fixed?

leontepe avatar Nov 17 '22 11:11 leontepe

The current state isn't necessarily representative; this uses an old version of druid-shell, for example. That is done to create a minimum compiling state.

We can revisit this once #1 lands.

DJMcNab avatar Nov 17 '22 12:11 DJMcNab

What @DJMcNab said. You want to be putting a lot more attention into #1, though it doesn't do anything interesting yet.

There are, however, a couple more things to say about the scroll example in the repo. One, it is slow on purpose (the list element computes an expensive hash), to compare against an equivalent SwiftUI program. Second, if you're running it on mac, it is running into a performance problem (expensive font creation) which has been fixed in later piet but not yet released. When I develop, it's locally patched. This is why we need to get the Druid 0.8 release done, and also why https://github.com/raphlinus/raphlinus.github.io/issues/74 hasn't been published yet after many months.

raphlinus avatar Nov 17 '22 12:11 raphlinus

Does that mean that Piet's release cycle is tied to Druid's?

ghost avatar Nov 17 '22 12:11 ghost

This may be the same thing I ran in to, caused by UI and computation sharing the same thread pool. I did modify the example to use a separate thread pool and cancellation.

Zoxc avatar Nov 17 '22 13:11 Zoxc

Does that mean that Piet's release cycle is tied to Druid's?

Technically doing a Piet release alone (without also releasing Druid) would improve the performance of the scrolling example. But I think the releases are highly related, as any applications built on Druid would suffer from the performance issue until the release is done. This is all somewhat irrelevant to Xilem though.

Regarding cancellation, this is a complex question. I'm pretty sure there's a discussion of it in Zulip, and it's part of my plans for the blog post to explain it reasonably well.

raphlinus avatar Nov 17 '22 14:11 raphlinus

The scroll example no longer exists. Additionally, we now use vello as the backend instead of piet.

Thanks for the report!

DJMcNab avatar Jan 09 '23 18:01 DJMcNab