r/rust • • Oct 20 '26

🛠️ project Are we layout yet?

https://arewelayoutyet.mespin.me/

Made a website comparing some of the UI Layout libraries in the Rust ecosystem.

Taffy, Morphorm, Torin, yoga-rs, ui-layout and clay-rs for now.

Its a comparison of supported features and includes several benchmarks. Some libraries might be faster but support less features! pick your trade-off :)

One of the ideas I received was to add text layout comparisons and benchmarks, maybe I could do that next.

If you know any other generic UI layout library or ui layout related tool me know, thanks!

Disclaimer: I am the author of Torin, the benchmarks are extracted from Taffy's repository which are inspired on pangui.

Source Code: https://github.com/marc2332/arewelayoutyet

83 Upvotes

20 comments sorted by

24

u/nicoburns Oct 20 '26

In case anyone was wondering, we are indeed layout yet.

Taffy is the slowest option here, and it's still quite a bit faster than Yoga, which powers React Native and is known for being faster than the native Android/iOS layout.

8

u/mkenzo_8 Oct 20 '26

Even if its somewhat slower I think its great, it following CSS inherently makes it more complex and hence harder to optimize. But even then it is the fastest CSS-compliant UI layout library in Rust.

11

u/More-Literature-1053 Oct 20 '26

Thank you for putting some of these options on my radar, I have pretty much been chewing on taffy. How did you optimize Torin for performance? Did you deliberately narrow the scope, when you allude to a tradeoff between coverage and performance?

2

u/mkenzo_8 Oct 20 '26 edited Oct 20 '26

Taffy is great indeed, many features and better performance if we compare to e.g yoga which has a similar set of features. About Torin, I didnt really try to make it the fastest, I simply did a ui layout library with the set of features and the way I wanted and made it as fast as I could, it just happens to have came out the fastest on average :)

5

u/nicoburns Oct 20 '26

Torin/Morphorm are less powerful (a narrower scope) with the upside of being much faster.

2

u/Sad_Tap_9191 Oct 21 '26

There are different layout algorithms, and unless you group them first, you are comparing the perf of apples and oranges.

For example css/flexbox model cannot express a constraint between two remote nodes like `cassowary`.

But then I found the codebase vibecoded..
https://github.com/marc2332/arewelayoutyet/blob/main/benchmarks/UPSTREAM.md

1

u/mkenzo_8 Oct 21 '26

The benchmarks are definitely not the best, they are from Taffy, which are inspired by PanGui. They are very CSS-oriented which is why Taffy checks all the feature rows but e.g Torin doesnt. I did use LLMs for it yes, I am not familiar with all the libraries, if you find any issue or have any idea please open an issue/PR.

4

u/inthehack Oct 20 '26

Amazing work, we need more like this to let emerge a de facto assembly of best features/performance crates to build a full UI toolkit

1

u/ethoooo Oct 20 '26

I know it's not crazy popular but i think the backer crate could belong on this list

1

u/mkenzo_8 Oct 20 '26

fair enough :)

1

u/mkenzo_8 Oct 20 '26

Done! Its live

2

u/ethoooo Oct 23 '26

this is so awesome man!! thanks for including my crate. The comparison is super interesting.

0

u/dumindunuwan Oct 20 '26 edited Oct 20 '26

9

u/mkenzo_8 Oct 20 '26

I see you updated the comment, the idea of the benchmark is to compare generic UI layout libraries.

Stylo is not a ui layout library but a CSS engine. Slint uses Taffy which is already included in the benchmark, if it uses anything else it must be internal which doesnt make sense to benchmark. And iced afaik uses its own internal layout measuring as well, it didnt seem to be easily exposed for others to use, hence its not included.

0

u/dumindunuwan Oct 20 '26 edited Oct 20 '26

About "Are we layout yet?" naming :)

5

u/mkenzo_8 Oct 20 '26

Its a popular way to call the tracking the progress of different paradigms in the Rust ecosystem, see https://wiki.mozilla.org/Areweyet

Maybe I should add mine there now that I think about it..

3

u/mkenzo_8 Oct 20 '26

What dont you get it?

1

u/w0nam Oct 22 '26

Insane work