Hanzo GUI

Benchmarks

Performance tests and comparisons

Hanzo GUI compares well to the fastest libraries at runtime, and the compiler further optimizes your styled components, flattening them down and hoisting objects out of your rendering loop (and extracting CSS on the web).

With the compiler on Hanzo GUI will output near optimal React code despite giving many nice shorthand style props. It has a higher impact on web, but with initial support for flattening more dynamic styled components now landed, Hanzo GUI does flatten a very high % of your code on all platforms. We look forward to updating our benchmarks as we expect we've improved in a number of areas.

It's important to note that benchmarks never show a complete picture. Our plan is to build out a better benchmarking setup to update this page.

React Native

In this benchmark Hanzo GUI is within 10% of the speed of vanilla React Native, even when using nearly all of Hanzo GUI's features. We render list of 28 items with a few sections, text and images. Average of 5 runs on a Apple M2 Air:

Running Hanzo GUI without the compiler averages 125ms or ~12% slower. Note that the compiler is much more effective on the web as it turns many more props into CSS and both bundle size and render performance are more important.

Web

We forked and ran a few more benchmarks for the web.

Legend: RNW = react-native-web, SC = styled-components

Simple component

Timing rendering a simple custom component.

Updating variants

Changing variants is fast at runtime, and even faster when compiled:

Since styled-components and Emotion don't offer a first-class variant API, this was done via prop interpolation.

Updating inline styles

Hanzo GUI has a big advantage for inline styles, it's the only library to compile them and flatten the tree.


Fully dynamic styles

These benchmarks don't benefit from the compiler. The React Native API surface is much more feature-rich than DOM.

Note: This test was taken from the styled-components benchmarks.

Mounting deep tree

In this test, we mount a tree with many nested nodes.

  • SC - Styled Components

Note: This test was taken from the styled-components benchmarks.

Last updated on

On this page