Preact: Add demos for performance comparisons

Created on 6 Jun 2018  Â·  6Comments  Â·  Source: preactjs/preact

We have more and more PRs where we need to do a performance review (example: #1135 ). Besides just measuring numbers I'd love to add some real world demos, where we can verify the responsiveness similar to react's triangle fiber demo. This would also be beneficial when playing around with async rendering when we'll make changes to our internals.

Possible candidates:

Most helpful comment

Crucially the point of the triangle demo isn't to demo "performance", it's to show that there's separate scheduling for high priority and low priority updates, and that we can "rebase" the low priority reconciliation on top of a high priority update. It's nothing Preact would be able to do anyway without implementing a double buffer like in Fiber (and then resuming — which we are still missing).

All 6 comments

I have a preact copy of that fiber demo somewhere

In the first codepen demo, when selecting setImmediate or Promise timing options my Chrome tab just hangs.

@mkxml yeah, I should really update that one - it relies on a componentDidUpdate() -> setState() loop, which is no longer a supported way to animate things in Preact as of version 8.

To be clear — the Fiber demo has been broken for over a year because it lacks the crucial "resuming" feature (which is something we still need to add). Without resuming, the Fiber triangle demo makes no sense. Most people who've seen the demo unfortunately misunderstand what it's supposed to be demoing (that's our fault).

Crucially the point of the triangle demo isn't to demo "performance", it's to show that there's separate scheduling for high priority and low priority updates, and that we can "rebase" the low priority reconciliation on top of a high priority update. It's nothing Preact would be able to do anyway without implementing a double buffer like in Fiber (and then resuming — which we are still missing).

Yup, the thing being demo'd there is actually a good summary of what is out-of-scope for Preact.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marcosguti picture marcosguti  Â·  3Comments

KnisterPeter picture KnisterPeter  Â·  3Comments

skaraman picture skaraman  Â·  3Comments

mizchi picture mizchi  Â·  3Comments

youngwind picture youngwind  Â·  3Comments