Repository navigation
Codex Retain 0.1.5
Codex Retain 0.1.5
Major peak-memory and CPU optimization release across archive scanning,
rollout-lineage discovery, report serialization, and batched deletion, while
preserving all existing CLI, JSON, policy, capture, recovery-journal, and
safety contracts.
What changed
- Compact report storage and streaming JSON: Replaces per-entry heap
materialization with 28-byteCompactEntryrecords, chunked byte arenas,
interned diagnostics, and direct 64 KiB buffered JSON output (itoa) across
enable,preview,run, andrun --scheduled. Text and scheduled runs
materialize only the 30 display entries and up to 10 diagnostic skips needed
forlast-run.json. - SQLite scan and statement reuse: Decouples large archive reads into
sequential scans (visit_archived_compact), adds due-count pre-sizing for
summary/text paths, compiles per-batch SQL statements once per run, and
bounds SQLite page caches (cache_size = -256RO /-512RW) with
PRAGMA shrink_memorybefore inventory peaks. - Direct descriptor traversal and compact inventory: Replaces
walkdir
withrustix::fs::Dirand directory-relative syscalls (openat,statat,
fstat,unlinkat,renameat_with), packs standard rollout filenames
inline intoHeaderCache(48-byte slabs) andOwnedRollout, reuseszstd
decoders across files, and switches internal hot maps/sets to a per-process
seededwymixhasher. - Targeted narrow hot-path crates: Uses
memchrfor SIMD newline/NUL
scans,simdutf8for SIMD UTF-8 validation paired withserde_json
from_str(with coldfrom_slicefallback for exact error diagnostics on
invalid UTF-8),itoafor integer formatting, andsmallvecfor small
per-batch scratch buffers. - Smaller release binary: Removes
walkdir(and its transitive
dependencies) and enables full symbol stripping (strip = true), reducing
the ARM64 macOS release binary from 4.43 MiB to 3.54 MiB (−20.1%). - Dependency security updates and attributions: Updated
rusqliteto
0.41.1(libsqlite3-sys 0.39.1/ SQLite3.54.1),rustixto1.1.6,
andzstdto0.14.3(zstd-safe 8.2.0,zstd-sys 2.1.2+zstd.1.5.7) to
addressRUSTSEC-2026-0391,RUSTSEC-2026-0398,RUSTSEC-2026-0403,
RUSTSEC-2026-0410,RUSTSEC-2026-0459, andRUSTSEC-2026-0486, and
regeneratedTHIRD_PARTY_NOTICES.mdand
docs/evidence/dependency-licenses.jsonfor the updatedCargo.lock.
Measured impact (local ARM64 macOS, synthetic profiles)
Paired /usr/bin/time -l measurements comparing local Rust 1.98.1 release
builds of 0.1.4 and 0.1.5 on identical synthetic profiles:
| Synthetic workload | 0.1.4 footprint | 0.1.5 footprint | 0.1.4 user CPU | 0.1.5 user CPU |
|---|---|---|---|---|
enable --json (100k archives) |
111.05 MiB | 9.30 MiB (−91.6%) | 0.28 s | 0.17 s |
preview --json (100k archives) |
26.48 MiB | 7.00 MiB (−73.6%) | 0.16 s | 0.07 s |
preview text (100k archives) |
26.45 MiB | 2.16 MiB (−91.8%) | 0.14 s | < 0.01 s |
run --scheduled (100k, none due) |
4.42 MiB | 2.41 MiB (−45.5%) | 0.14 s | < 0.01 s |
run --json (delete 10k archives) |
29.00 MiB | 7.94 MiB (−72.6%) | 1.22 s | 0.32 s |
run --scheduled (delete 10k) |
27.50 MiB | 7.80 MiB (−71.6%) | 0.86 s | 0.34 s |
preview --json (99k active + 1k arch) |
11.11 MiB | 3.83 MiB (−65.5%) | 1.27 s | 0.41 s |
run --json (99k active + 1k arch, 1 due) |
50.25 MiB | 8.05 MiB (−84.0%) | 0.77 s | 0.23 s |
These local measurements use synthetic profiles on ARM64 macOS and do not
establish cold-cache I/O latency, Intel macOS timings, or live-writer latency.
Update
brew update
brew upgrade dankosik/codex-retain/codex-retain
codex-retain --version
codex-retain statusInstaller users can rerun the installer at the same installation directory.
Installation does not enable retention. Existing policies, exclusions,
captured archive periods, and journal schemas remain unchanged.
Compatibility remains the reviewed Codex 0.153.4 storage protocol, with macOS
15+ packages for Apple Silicon and Intel. All validation uses synthetic
profiles.