Skip to content

Latest commit

 

History

History

bench

readme.md

Bench

The bench builds a generated site of 10,000 Markdown pages with bongo, as a fresh build, after each kind of edit, and in bongo dev. It also builds the docs site, and the same 10,000 pages with Astro.

For each change that was measured, and what each one found, see the bench history.

Latest numbers

bongo at 9398aff, on an idle Apple M1 Max (10 cores), 64 GB, macOS (darwin 24.6.0), Bun 1.4.3.

bongo build, 10,000 pages

build wall peak RSS files written
fresh 2.19 s 506 MB 10,105
no change 239 ms 217 MB 4
body edit 248 ms 220 MB 5
title edit 337 ms 280 MB 205
new page 335 ms 284 MB 206
stylesheet edit 2.19 s 608 MB 10,105
layout edit 2.17 s 606 MB 10,105

A body edit renders only its page. A title edit also renders the 100 pages of its section, since each links its neighbours, and each section index and the sitemap, since they list every page. A stylesheet or layout edit renders every page. A build with no change still writes the 3 bundles and the sitemap.

The docs site, 109 files, builds fresh in 218 ms, with a peak RSS of 190 MB.

bongo dev, 10,000 pages

step time footprint after
first build 1.60 s 308 MB
layout edit 1.50 s 168 MB
page edit 88–95 ms 168 MB
stylesheet edit 87–89 ms 168 MB
new page 151 ms 168 MB

Footprint is the memory that Activity Monitor shows. dev names each stylesheet by its entry, not by its content, so a stylesheet edit renders no page.

bongo vs Astro

The same 10,000 pages, layouts, and assets, built with Astro 7.4.1 from astro/. Each row is a median of 5 runs.

build wall peak RSS output
bongo, fresh 2.19 s 506 MB 10,105 files · 90 MB
bongo, no change 239 ms 217 MB
Astro, fresh, Node 26.11 14.05 s 2970 MB 10,106 files · 104 MB
Astro, fresh, Bun 1.4.3 12.04 s 3082 MB
Astro, no change, Node 26.11 7.69 s 2735 MB

A fresh bongo build is about 6× faster than Astro (5.5× on Bun, 6.4× on Node), with a sixth of its memory. With no change, bongo is about 32× faster: Astro keeps its parsed Markdown in a cache, but it still renders every page.

Both sites have the same table of contents, pager, tags, dates, sitemap, stylesheet, script, view transitions, and prefetch. The stylesheet is an external file in both. bongo highlights code with twinkleplop, and Astro with Shiki, its default.

The generated site

content.ts writes site/content/: 100 sections of 100 Markdown pages, an index for each section, a home page, and a sitemap. Each page has frontmatter with a title, a summary, a date, and tags, then 2–5 sections of text, lists, tables, quotes, and code blocks. The same page count writes the same bytes on every run.

site/ builds them with the Markdown plugin, code highlighting for 4 languages, a table of contents, a pager, and the client runtime.

Run it

From the repository root:

bun install
bun run bench

It builds the packages, writes the site, and runs each target. To run only some targets, name them:

bun run bench site docs
target what it measures
site bongo build --fresh of the generated site: 1 warmup and 5 runs, with the time and memory of each stage
docs bongo build --fresh of the docs site, in the same way
incremental bongo build after each kind of edit, 5 runs each, then a fresh build to check that the bytes match
dev bongo dev: the first build, and 3 each of layout, page, and stylesheet edits, then a new page
option default
--runs, -r 5 runs of each build
--pages, -p 10000 pages in the generated site

To build the same site with Astro, write the content first, then:

cd bench/astro
bun install
node node_modules/.bin/astro build

Run the bench on an idle machine. Other work on the CPU slows the build, but not its CPU time, so a wall time that is much higher than its user and sys times is a sign of load.