https://github.com/haikyuu/benchmark
A barebones benchmark comparing imba, React and maybe other frameworks
https://github.com/haikyuu/benchmark
benchmark imba performance react vite
Last synced: 4 months ago
JSON representation
A barebones benchmark comparing imba, React and maybe other frameworks
- Host: GitHub
- URL: https://github.com/haikyuu/benchmark
- Owner: haikyuu
- Created: 2022-09-30T09:23:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-30T13:32:53.000Z (over 3 years ago)
- Last Synced: 2025-10-11T18:41:35.482Z (8 months ago)
- Topics: benchmark, imba, performance, react, vite
- Language: JavaScript
- Homepage: https://benchmark-95q.pages.dev/
- Size: 101 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Introduction
This is a benchmark to test Imba against React and Svelte. This is obviously **not** an extensive benchmark, but just to illustrate a point: Imba is very fast! ... 9 times faster than React and Svelte.
How comes? Well, Imba uses a different technique called the memoized DOM [Check out how it works](https://imba.io/guides/rendering). It would be interesting to see other libraries and frameworks adopt it since it's so effecient.
The benchmark is a very simple automated test that playwright runs for each framework.
The test is very simple: it just clicks 500 times on a button that increments 10k other buttons
```
await Promise.all(Array.from(Array(count).keys()).map(()=> page.locator(`data-testid=${target}-1`).click())); // target is replaced with each framework
await expect(button1).toHaveText(`${count + 1}`)
```
No tricks here ^^' Inspect the code, run it locally and optimize if you feel like it.

Results of running the benchmark can be seen here https://imba-benchmark.netlify.app/
Results are built on every push to main branch. And you can see the same results by inspecting github actions artifacts. Github actions machine is a bit more powerful than Netlify, so results are different but within the same range.
## Profiling
In the following manual test, I clicked 20 times on buttons of each respective "framework".
*If you know a way to automate this profiling, create an issue or a PR. I'd love to include that instead.*
Look at the scripting portion or even better, try the profiling in your browser:
- Imba: 147ms
- Svelte: 487ms
- React: 589ms
### React results

### Imba results

### Svelte results