Skip to content

Comments

feat(runtime): use queued based rendering#15471

Merged
ematipico merged 30 commits intomainfrom
refactor/rendere-queue
Feb 24, 2026
Merged

feat(runtime): use queued based rendering#15471
ematipico merged 30 commits intomainfrom
refactor/rendere-queue

Conversation

@ematipico
Copy link
Member

@ematipico ematipico commented Feb 11, 2026

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

@changeset-bot
Copy link

changeset-bot bot commented Feb 11, 2026

🦋 Changeset detected

Latest 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

@ematipico ematipico changed the title Refactor/rendere queue refactor(runtime): use queued based rendering Feb 11, 2026
@github-actions github-actions bot added 🚨 action Modifies GitHub Actions pkg: astro Related to the core `astro` package (scope) docs pr labels Feb 11, 2026
@ematipico ematipico force-pushed the refactor/rendere-queue branch from ea457e4 to ff9b1ed Compare February 11, 2026 12:11
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 11, 2026

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing refactor/rendere-queue (a4f39a6) with main (be1c87e)

Open in CodSpeed

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Feb 13, 2026
@ArmandPhilippot
Copy link
Member

Following TBD, I don't know if you wanted more data here or on Discord, but running the benchmark locally gives me:

 BENCH  Summary

  Queue Build: hybrid site (static + server) - bench/build-hybrid.bench.js > Bench build time
    1.00x faster than Build: hybrid site (static + server)

  Build: full server site - bench/build-server.bench.js > Bench build time
    1.00x faster than Queue Build: full server site

  Queue Build: rendering static site - bench/build-static.bench.js > Bench build time
    1.17x faster than Build: full static site

  Queue+Pool - bench/render.bench.js > .astro [streaming]
    1.12x faster than Queue
    2.45x faster than Queue+Cache
    2.45x faster than Queue+Pool+Cache
    2.47x faster than Classic

  Queue+Pool - bench/render.bench.js > .astro [buffered]
    1.10x faster than Queue
    2.24x faster than Queue+Pool+Cache
    2.24x faster than Queue+Cache
    2.26x faster than Classic

  Queue - bench/render.bench.js > .md [streaming]
    1.06x faster than Queue+Pool
    1.11x faster than Queue+Cache
    1.16x faster than Classic
    1.18x faster than Queue+Pool+Cache

  Queue+Cache - bench/render.bench.js > .md [buffered]
    1.00x faster than Queue+Pool
    1.01x faster than Queue
    1.03x faster than Classic
    1.12x faster than Queue+Pool+Cache

  Queue - bench/render.bench.js > .mdx [streaming]
    1.51x faster than Queue+Pool
    1.70x faster than Queue+Cache
    2.21x faster than Queue+Pool+Cache
    3.39x faster than Classic

  Queue - bench/render.bench.js > .mdx [buffered]
    1.35x faster than Queue+Pool
    1.56x faster than Queue+Cache
    2.04x faster than Queue+Pool+Cache
    3.05x faster than Classic

I run it twice, above is the most recent one and here's a screenshot I took earlier if that helps!

@ematipico ematipico force-pushed the refactor/rendere-queue branch 2 times, most recently from 46ce94a to baff40a Compare February 17, 2026 10:46
@ematipico ematipico marked this pull request as ready for review February 17, 2026 15:44
@ematipico ematipico changed the title refactor(runtime): use queued based rendering feat(runtime): use queued based rendering Feb 17, 2026
@ascorbic ascorbic added pr preview Apply this label to a PR to generate a preview release and removed pr preview Apply this label to a PR to generate a preview release labels Feb 21, 2026
@ematipico ematipico force-pushed the refactor/rendere-queue branch from 167eb32 to e949724 Compare February 23, 2026 10:07
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a tiny bit of changeset cleanup here, and please take a look at the config.ts in particular!


#### 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few suggestions from me 🙌

ematipico and others added 2 commits February 24, 2026 09:19
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Copy link
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just one final suggestion that wasn't applied

ematipico and others added 2 commits February 24, 2026 15:41
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for docs! 🫡

Copy link
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Co-authored-by: Armand Philippot <git@armand.philippot.eu>
@ematipico ematipico merged commit 32b4302 into main Feb 24, 2026
11 of 12 checks passed
@ematipico ematipico deleted the refactor/rendere-queue branch February 24, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚨 action Modifies GitHub Actions docs pr pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants