-
Notifications
You must be signed in to change notification settings - Fork 10
Forgo benchmark results #46
Description
I've submitted Forgo to the JS framework benchmark suite. Forgo's performance has been adequate for my own apps so far, but I'm not really pushing the envelope. Forgo doesn't need to be "the fastest gun in the West", but we want to make sure it's not the slowest, either.
The official results won't include Forgo until the PR gets accepted, but here's what I see running select benchmarks locally. All scores are mean-average milliseconds.
| Forgo | VanillaJS | Mithril | React Hooks | Alpine | |
|---|---|---|---|---|---|
| Insert 1,000 elements | 170 | 84 | 121 | 120 | 285 |
| Update every 10th row | 1,100 | 187 | 278 | 216 | 239 |
| Insert 10,000 rows | 1,649 | 1,014 | 1,305 | 1,556 | 2,768 |
The tests discourage microoptimizing - they should reflect idiomatic usage of the framework.
- VanillaJS is obviously our theoretical maximum performance.
- Alpine is the slowest framework in several categories on the official results.
- Mithril is our closest analog. Similar component model, similar scope, manual rerenders, etc. So it should be possible for us to hit their performance.
- And React because why not ¯\_(ツ)_/¯
So anyways...
Forgo's on the slower side, with some room for improvement, especially for mutating existing elements.
Any thoughts on low-hanging fruit to target?
Here's the flamegraph for the Insert 10k test:

I don't know how to tie a specific item in that graph to which component was being rendered (short of just stepping through the debugger until I've hit a function N times), but there's clearly a lot going on.
