Skip to content

v0.2.0: test infra + bench harness + measured perf claims - #6

Merged
theYahia merged 2 commits into
mainfrom
track-cd-phase-a-tests
May 1, 2026
Merged

v0.2.0: test infra + bench harness + measured perf claims#6
theYahia merged 2 commits into
mainfrom
track-cd-phase-a-tests

Conversation

@theYahia

@theYahia theYahia commented May 1, 2026

Copy link
Copy Markdown
Owner

Summary

Phase A milestone per coordinated implementation plan: ship credibility (numbers + tests) before Phase B-D ops/docs work.

  • Tests: 8 node:test unit tests covering cache.js public API; built-in runner, zero new devDeps
  • Bench: npm run bench reports p50/p95/p99 latency for write/read hit/read miss/list, plus storage growth. JSON results saved with full machine metadata (CPU, RAM, OS, Node version, commit) for reproducible before/after comparisons. Canonical baseline committed to bench/baselines/; ephemeral runs go to gitignored bench/results/.
  • CI: real npm test job replaces misnamed publish --dry-run-only workflow; publish-dry-run gated on tests green
  • Docs: README replaces unmeasured "5-15x fewer WebFetch calls" headline with measured "~0.05ms cached reads"; CHANGELOG backfilled (0.1.4 unlimited TTL, 0.1.5 auto-cache hook) and 0.2.0 entry added

Bench numbers (Ryzen 3900X, Node v24.14, win32, N=10000)

Op p50 p95 p99 ops/sec
read_hit 0.05ms 0.08ms 0.13ms 12,300
read_miss 0.01ms 0.03ms 0.05ms 69,700
write 0.06ms 0.12ms 1.30ms 8,100
list_50 0.08ms 0.13ms 0.40ms 10,600

Storage: ~1.9KB per entry on 1KB payload (overhead ~ 900B for key + indexes + WAL).

Test plan

  • CI test job green on Linux/Node 22.5
  • CI publish-dry-run still green (regression check)
  • Local npm test 8/8 pass (Windows/Node 24.14)
  • Local npm run bench produces JSON in bench/results/ + canonical baseline saved

🤖 Generated with Claude Code

Tim added 2 commits May 1, 2026 15:25
- node:test unit suite (8 tests, ~400ms): makeKey, set/get round-trip,
  hit_count update, TTL expiry, upsert, purgeExpired Infinity no-op, stats
- bench/run.js: latency + storage harness, JSON results with machine metadata
- CI workflow: real npm test job, publish-dry-run gated on test green
- README: replace unmeasured "5-15x fewer" with measured "~0.05ms reads"
- CHANGELOG: backfill 0.1.4 + 0.1.5, add 0.2.0 entry
… 22.5

22.5 added node:sqlite behind --experimental-sqlite flag. Unflagged since
23.x, stable since 24.x. Local test runs (Node 24.14) passed but CI
(node-version: '22.5') failed with ERR_UNKNOWN_BUILTIN_MODULE because
neither helpers.js nor cache.js passes the flag. Bump CI to match the
actual supported runtime; separate issue covers package.json engines.
@theYahia
theYahia merged commit 03345da into main May 1, 2026
2 checks passed
@theYahia
theYahia deleted the track-cd-phase-a-tests branch May 1, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant