@nical Thanks for sharing! I'm surprised on how inefficient this is. I'm just a gamedev, but this is a great example on how NOT to build a performant UI in games :)

Would be interesting to compare how long it takes on the same machine for the vulkan GSK renderer to render a frame and then build that same UI a game with say Unity (the game editor) and compare the results. Maybe something for a weekend if I get bored...

@xiaoluoman other than the draw call count, it's pretty sane overall IMHO in the context of app UI. Not optimal but game UIs tend to be a lot less efficient as they typically redraw each frame from scratch while GTK or browsers redraw only the portion of the window that has changed. That has a much bigger impact than anything else on power usage. Game UIs are typically built upon a very simple set of primitives whereas GTK and, to a greater extent, the web handle a very expressive drawing model
@xiaoluoman At the end of the day it has to be put in context. I would not advise using or copying GTK in a game engine, but I have also never seen a game UI framework that can render a desktop app (with the feature set that you expect from a desktop UI framework) without drawing orders of magnitude more power than GTK or a web browser do. Different sets of constraints and content to optimize for.
@xiaoluoman That said I would love to see the same frame breakdown in unity! Please ping me if you ever get to it.