Skip to content
zit zit 0.3.19
Login

zit 0.3.19

zit 0.3.19 takes most of a second off zit log on a large repository. The cost was not cold open, which was the standing suspicion: it was log opening the repository in the mode meant for write verbs, and doing it twice. A warm log on a million-artifact store now returns its first row in about a tenth of a second, and on a hundred-thousand-artifact store in about a fiftieth.

No artifact, tag namespace, sync message, or on-disk repository format changed.

log opens on the zero-parse image

A warm cache hit reads exactly one sidecar, the repository image, and points at it in place. What the open does after the bytes land depends on the mode the verb asks for. Read verbs ask for the image and get a view in the time it takes to checksum it. Write verbs ask for the full derive, which replays every record out of the image into a mutable state, because an image is read-only by construction.

log reached past the open funnel every other read verb goes through and called the repository open with a default options struct. The default was the full replay. For a symbolic name such as trunk it did so twice: once to resolve the name, once to walk. Nothing failed, output was correct, and every log paid two write-verb opens for a read.

log now opens once, on the image path, shared by name resolution, the PATH route and the default listing. A bare --long listing of a literal ID, which needs no view at all, skips the open entirely. Output is byte-identical on every route.

release build, warm page cache 0.3.18 0.3.19
log -n 1 trunk, SQLite mirror (131,558 artifacts) 0.46s 0.02s
log -n 1 trunk, pkgsrc sub-manifest mirror (1,249,347 artifacts) 0.94s 0.05–0.10s
log --long -n 3 trunk src/btree.c, SQLite mirror 0.48s 0.07s
log --long -n 5 trunk Makefile, pkgsrc sub-manifest mirror 1.32s 0.40s

What remains on the pkgsrc per-file query is after open: the manifest reads --long needs for its rows, and the index lookup.

The open mode is no longer defaulted

The trap that made this a bug rather than a design was a defaulted field: a verb that opened the repository directly and said nothing about mode got the full replay silently. The same trap caught diff in an earlier release. The field has no default now; every direct caller declares the mode it wants, so the next verb written past the funnel cannot inherit the expensive one without saying so. Every existing caller other than log declares the mode it already had, so nothing else changed behaviour.

An end-to-end test runs every log route on a flat store and a tree store under the derive-footprint seam and fails if any of them replays a record.

Compatibility

Qualification

zig build test, e2e, smoke (Fossil interop against a real fossil), muscle, git-import-e2e, git-export-e2e, dst, and cross, plus the three-runner CI battery. The timings are release builds against the mirrors in the benchmark corpus, warm cache, both columns run alone on the same machine, with each route's output compared byte for byte between the two builds.