~ knotless Search/
↑↓ move↵ open⇧↵ all results

zat.dev/zlay

atproto relay in zig · mirror of https://tangled.org/zat.dev/zlay

0
0
60 lines · 3.4 KB Raw History

Relay build cost and executable size

The earlier paired samples below show build and executable-size costs at their recorded revisions. They are historical measurements, not timings of the latest source. Runtime behavior is covered separately in the relay results.

Measurementzkv pilotRocksDB control
Fresh-cache build91.55 s213.10 s
Unchanged rebuild0.201 s0.253 s
Strip-enabled rebuild30.38 s34.45 s
Default ELF file19,127,176 B164,043,096 B
Default ELF loadable file bytes4,214,404 B15,193,436 B
Strip-enabled ELF file3,996,456 B14,971,840 B
Strip-enabled ELF loadable file bytes3,994,508 B14,969,580 B

Both builds use Zig 0.17.0, zio, ReleaseSafe, x86_64-linux-gnu and -j2 on the same Apple M5 Pro. Builds run sequentially from temporary source snapshots with separate, initially empty local and global Zig caches. Dependencies are already downloaded and shared read-only through the existing package directories; sandbox-exec denies network access. OS filesystem caches are not cleared. This is one sample per engine and phase, not a compile-time distribution or a CI-host estimate. Strip-enabled rebuild time reuses the fresh build's caches; it is not a second clean-build measurement.

Only the temporary build scripts change: the git subprocess becomes the same captured short-SHA literal, and the relay module gains an optional strip flag. The default measurement leaves stripping disabled. Stripped sizes come from an actual strip-enabled Zig rebuild, not subtraction of debug-section sizes. An earlier measurement script attempted zig objcopy --strip-all, which is unimplemented in this compiler; its incomplete run is excluded.

ELF loadable bytes sum PT_LOAD file sizes. They do not measure page faults, resident memory, heap use or per-connection overhead. /usr/bin/time -l build resource observations are retained in each log; they should not be mistaken for the relay's runtime memory consumption or an aggregate peak across simultaneous compiler children. Default ELF size is dominated by debugging information, especially for RocksDB's C++ dependency.

The measurement script records exact source revisions, source hashes including core zkv, flags, executable hashes and program header sizes in results.json. Fresh and unchanged build logs for zkv and RocksDB are retained alongside it. Temporary sources, executables and compiler caches were deleted automatically. No production build, deployment or upstream network request was performed.

2026-11-06 candidate

The normal stripped x86-64 Linux/zio ReleaseSafe relay at 244d209, with zkv 90f72c8, is 4,067,912 bytes (3.88 MiB); loadable file bytes are 4,065,956. Offline replay and stage profiling are disabled. The build reused existing compiler/package caches; no fresh-cache timing comparison was repeated. Exact flags, source pins and binary hash.

The migration branch keeps RocksDB behind the opt-in migration-tools build option, for the separate conversion executable. Normal relay builds do not instantiate that dependency or link its C++ library. This is separate from removing old production data, which requires the migration and rollback checks.