Home Documentation Templates Examples Showcase GitHub
Theme

Performance · v4.2.0 comparison

Performance: what v4.3 costs.

Nift v4.3 added a substantially larger language/content surface: functions and fragments, structs, richer expressions, a project model with typed content, schemas, taxonomies and agent-facing functionality. The architecture deliberately follows pay-for-what-you-use: an ordinary project pays little for features it does not use, and project-aware builds pay only when project-wide facilities are actually requested.

The released-v4.2.0 comparison

Both binaries were built from identical sources with identical release flags (g++ -std=c++17 -O2) and run on identical generated fixtures (front-matter pages, @content template, parallel build, tmpfs, Linux x86-64). Ordinary full-build wall time is the median of three runs; output is byte-identical between versions.

Pagesv4.2.0v4.3Ratio
1000.005s0.006s1.04x
1,0000.019s0.023s1.19x
5,0000.065s0.076s1.17x
10,0000.122s0.131s1.07x

Peak RSS at 10,000 pages: v4.2.0 ~11 MB vs v4.3 ~12 MB. Both versions scale approximately linearly. Incremental builds (no-change, body edit, front-matter edit, template edit, add, remove, rename) are all within ~1.0–1.2x of v4.2.0 at 10,000 pages.

Pay-for-what-you-use

An ordinary project never constructs the project-wide query model: no project fingerprint is produced, and none of the project content is read for model construction. Enabling project-aware access pays for the model once per build, shared across pages.

10,000 pagesTimeRSS
@content only0.115s12.3 MB
+ expressions / functions / structs~0.12s~12 MB
+ typed content / schemas~0.12s~15 MB
+ project.files / project.content / taxonomies~0.29s~59 MB

Enabling one feature does not unexpectedly activate unrelated machinery. The project-aware cost is the constructed-and-shared project model; it is not paid by ordinary builds.

The engineering result

The useful story is not a single number. v4.3 keeps approximately linear build scaling, produces byte-identical output to v4.2.0 on ordinary projects, stays within ~1.2x of v4.2.0 ordinary build time while adding a far richer language and content model, and avoids most of that richer feature cost when the features are unused. Early v4.3 development performed ~1.5–2x more work on ordinary builds (it constructed the full project model even when no template referenced it); that unused-feature overhead was removed.

Environment

Numbers above were measured on Linux x86-64 with g++ 15.2.0, fixtures on tmpfs (warm cache, no cold-cache claims). The maintained comparison harness is benchmarks/v420_comparison.py in the source tree; run it with a v4.2.0 binary and the current v4.3 binary to reproduce.