- Format:
make fmt - Tests:
make test(plusmake test-raceoptionally) - Bench:
make unified-bench && ./bin/unified-bench - Bench analysis:
make benchprof && ./bin/benchprof -profiles-dir <dir>
This repo is a dev playground for two storage engines (HashDB + TreeDB) and benchmark tooling.
“Tests are the north star”: changes should keep go test ./... passing and extend tests for new behavior.
- Go
1.25+(seego.mod) - Linux/macOS recommended (TreeDB is Unix-focused due to mmap/locking specifics)
make helpmake fmt- Optional local hook:
make hooks(runsgofmton staged.gofiles at commit time) make testmake vetmake tidymake buildmake unified-bench && ./bin/unified-benchmake benchprof- Optional (slow):
make test-race
GitHub Actions runs:
- Root module
go vet+go test ./...(Linux + macOS) - TreeDB
go vet+go test ./...(Linux + macOS) cmd/unified_benchgo vet+go test ./...(Linux + macOS)- HashDB
go vet+go test ./...(Windows) - Manual:
-raceruns (workflow dispatch)
- Keep commits small and reviewable.
- Prefer clear naming and simple control flow over cleverness.
- Keep the intended stable surface small:
github.com/snissn/gomap/TreeDB(packagetreedb)github.com/snissn/gomap/HashDB(packagehashdb)- See
docs/API_STABILITY.md.
- When changing semantics (durability/iteration/locking), update:
docs/contracts/*, and- the relevant spec tests.
- Prefer
-profile-dirover ad-hoc profile flags:OUT=$(mktemp -d /tmp/gomap_profiles_XXXXXX)./bin/unified-bench ... -profile-dir "$OUT"./bin/benchprof -profiles-dir "$OUT"
benchprofconsumes:benchprof_results.json/mdcpu_<test>_<db>.pprofallocs_<test>_<db>.pprofcheckpoint_cpu_checkpoint_<test>_<db>.pprofblock.pprof,mutex.pprof,trace.out
- If you change profile flag behavior, output names, or benchmark test names,
update
cmd/benchprof/main.goparsers andcmd/benchprof/main_test.goin the same PR.
Be extra careful when touching metadata formats or recovery logic:
- Add/extend tests that cover crash/reopen and truncated/corrupt tail cases.
- Prefer versioned metadata changes (explicit version fields).
- If compatibility is intentionally broken, document it in
docs/API_STABILITY.md/CHANGELOG.md.