aboutsummaryrefslogtreecommitdiff
path: root/benchmark/bench/render.js
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2024-02-14 10:14:05 -0500
committerGravatar GitHub <noreply@github.com> 2024-02-14 10:14:05 -0500
commitd469bebd7b45b060dc41d82ab1cf18ee6de7e051 (patch)
tree93335d8fbc46e1aa78c1f390d26bf4952e14ff15 /benchmark/bench/render.js
parent8c14143d0635b2571686d1c9bdc4fb3cc859b659 (diff)
downloadastro-d469bebd7b45b060dc41d82ab1cf18ee6de7e051.tar.gz
astro-d469bebd7b45b060dc41d82ab1cf18ee6de7e051.tar.zst
astro-d469bebd7b45b060dc41d82ab1cf18ee6de7e051.zip
Improve Node.js performance using an AsyncIterable (#9614)
* Improve Node.js performance using an AsyncIterable * Oops * Get rid of extra abstraction * Update .changeset/hip-cherries-behave.md Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> * Check if already resolved * Resolve on done * Get rid of unneeded "done" * Done when length is zero * Let errors resolve * Update packages/astro/src/runtime/server/render/astro/render.ts Co-authored-by: Emanuele Stoppa <my.burning@gmail.com> * Move doctype to top-level * Document the new function * Update .changeset/hip-cherries-behave.md Co-authored-by: Emanuele Stoppa <my.burning@gmail.com> * Update .changeset/hip-cherries-behave.md --------- Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Diffstat (limited to 'benchmark/bench/render.js')
-rw-r--r--benchmark/bench/render.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/benchmark/bench/render.js b/benchmark/bench/render.js
index ac733bdea..20c9abb0f 100644
--- a/benchmark/bench/render.js
+++ b/benchmark/bench/render.js
@@ -6,7 +6,7 @@ import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { waitUntilBusy } from 'port-authority';
import { calculateStat, astroBin } from './_util.js';
-import { renderFiles } from '../make-project/render-default.js';
+import { renderPages } from '../make-project/render-default.js';
const port = 4322;
@@ -57,7 +57,7 @@ export async function run(projectDir, outputFile) {
async function benchmarkRenderTime() {
/** @type {Record<string, number[]>} */
const result = {};
- for (const fileName of Object.keys(renderFiles)) {
+ for (const fileName of renderPages) {
// Render each file 100 times and push to an array
for (let i = 0; i < 100; i++) {
const pathname = '/' + fileName.slice(0, -path.extname(fileName).length);