feat(runtime): use queued based rendering#15471
Conversation
🦋 Changeset detectedLatest commit: a4f39a6 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
ea457e4 to
ff9b1ed
Compare
|
Following TBD, I don't know if you wanted more data here or on Discord, but running the benchmark locally gives me: I run it twice, above is the most recent one and here's a screenshot I took earlier if that helps! |
46ce94a to
baff40a
Compare
167eb32 to
e949724
Compare
sarah11918
left a comment
There was a problem hiding this comment.
This feature sounds amazing @ematipico ! Some thoughts on the changeset for your consideration! (Will also be looking at the Docs PR today)
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
sarah11918
left a comment
There was a problem hiding this comment.
Just a tiny bit of changeset cleanup here, and please take a look at the config.ts in particular!
.changeset/hot-eyes-sink.md
Outdated
|
|
||
| #### Pooling | ||
|
|
||
| With the new engine enabled, you now have the option to have a pool of nodes that can be saved and re-used across page rendering. Node pooling is useless in on-demand rendering (SSR), because rendering requests don't share memory. However, it can be very useful for performance when building static pages. |
There was a problem hiding this comment.
| With the new engine enabled, you now have the option to have a pool of nodes that can be saved and re-used across page rendering. Node pooling is useless in on-demand rendering (SSR), because rendering requests don't share memory. However, it can be very useful for performance when building static pages. | |
| With the new engine enabled, you now have the option to have a pool of nodes that can be saved and re-used across page rendering. Node pooling has no effect when rendering pages on demand (SSR), because these rendering requests don't share memory. However, it can be very useful for performance when building static pages. |
| svgo?: boolean | SvgoConfig; | ||
|
|
||
| /** | ||
| * @name experimental.queuedRendering |
There was a problem hiding this comment.
Noting that I'm not reviewing this because there's no @docs tag, but we should manually include the API reference (types, defaults) for poolSize and contentCache on the Experimental docs page!
yanthomasdev
left a comment
There was a problem hiding this comment.
A few suggestions from me 🙌
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com> Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
yanthomasdev
left a comment
There was a problem hiding this comment.
Looks good to me, just one final suggestion that wasn't applied
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Changes
Added a new experimental engine that is queue based. The engine comes with also a caching system , which can be configured.
The rendering engine also uses batching: all adjacent synchronous nodes that are simple (e.g. strings) are concatenated so that we use one single write.
This is an opt-in engine, and the objective is to consider this a valid evolution of how we render components in Astro.
The explanation of the features is the changeset, but I'm happy to answer any question or doing a deep dive of certain parts of the features.
The feature was created with the help of an AI agent, and I reviewed the majority of the code.
Testing
Many unit tests added to test the new feature.
Docs
withastro/docs#13299