Skip to content

Architecture benchmarks

These benchmarks validate core assumptions for the streaming and masking architecture before changing production code paths.

Prerequisites

# venv MUST be Python 3.12 โ€” SpaCy has no 3.13/3.14 wheels
python --version            # expect 3.12.x; else: rm -rf .venv && python3.12 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev,nlp]"
python -m spacy download en_core_web_sm   # SpaCy benchmark only

# Docker or Podman (rootless, Fedora-native):
docker compose -f compose.dev.yml up -d
# podman compose -f compose.dev.yml up -d
# Wait until both healthchecks pass (~10s on first start)

Optional: set SOURCE_DB_URL / TARGET_DB_URL in .env (defaults match compose.dev.yml ports 55432 / 55433).

Troubleshooting: No module named spacy โ†’ venv isn't 3.12. permission denied ... docker.sock โ†’ add yourself to the docker group or use Podman. See docs/local-development.md ยง4.4.

Run all benchmarks

export SOURCE_DB_URL=postgresql://postgres:dev@localhost:55432/privaci_source
export TARGET_DB_URL=postgresql://postgres:dev@localhost:55433/privaci_target
python scripts/spikes/run_week1_spikes.py

Or via pytest (integration + spike markers):

pytest tests/spikes -m "integration and spike" -v
pytest tests/spikes -m "spike and not integration" -v   # SpaCy only

Benchmark documents

Topic Document Code
COPY-binary round-trip 2.1-copy-binary.md privaci.spikes.copy_binary
SpaCy throughput 2.2-spacy-throughput.md privaci.spikes.spacy_throughput
Cyclic FK deferred 2.3-cyclic-fk-deferred.md privaci.spikes.cyclic_fk

AWS Marketplace listing validation notes live in the private commercial repository (ADR-0007).

After running benchmarks locally, update the per-topic markdown files with your machine's metrics and any blockers found.