diff --git a/docs/00-INDEX.md b/docs/00-INDEX.md index f9c46e9..74ecab9 100644 --- a/docs/00-INDEX.md +++ b/docs/00-INDEX.md @@ -18,6 +18,7 @@ These are **policy-as-code**. Any gate (push, release, publish) MUST call `./ci/ - **Local CI Contract:** `./ci/run.sh` — Single source of truth for CI/release gates - **Verification / Invariants:** `./scripts/verify.sh` — Encodes packaging, core-purity, and build invariants - **CI Usage & Setup:** `ci/README.md` — Local CI documentation +- **Performance Characteristics:** `docs/PERFORMANCE.md` — Performance characteristics and benchmarks --- diff --git a/docs/PERFORMANCE.md b/docs/PERFORMANCE.md new file mode 100644 index 0000000..0937984 --- /dev/null +++ b/docs/PERFORMANCE.md @@ -0,0 +1,61 @@ +# Performance Characteristics + +**Purpose:** Expected performance characteristics and benchmarks for Daily Notification Plugin operations. +**Owner:** Development Team +**Last Updated:** 2025-12-22 +**Status:** active + +--- + +## Expected Operation Times + +### Scheduling Operations +- **Schedule creation:** < 50ms (typical), < 100ms (p95) +- **Schedule update:** < 50ms (typical), < 100ms (p95) +- **Schedule deletion:** < 50ms (typical), < 100ms (p95) + +### Recovery Operations +- **Cold start recovery:** < 500ms (typical), < 1000ms (p95) +- **Force stop recovery:** < 500ms (typical), < 1000ms (p95) +- **Boot recovery:** < 1000ms (typical), < 2000ms (p95) + +### Database Operations +- **Query (getEnabled):** < 50ms (typical), < 100ms (p95) +- **Query (getById):** < 10ms (typical), < 20ms (p95) +- **Insert/Update:** < 50ms (typical), < 100ms (p95) + +## Memory Footprint + +- **In-memory metrics:** ~10KB per 100 metrics +- **Event logs:** ~5KB per 100 events +- **Total overhead:** < 100KB (development mode), < 10KB (production, metrics disabled) + +## Platform-Specific Considerations + +### iOS +- Background task time limits: ~30 seconds +- CoreData auto-migration: typically < 100ms + +### Android +- WorkManager execution time limits: flexible (minutes) +- Room migrations: typically < 200ms + +### Web +- No background execution limits +- No native database operations + +## Measurement Methodology + +Metrics are collected using: +- `performance.now()` (Web/TypeScript) +- `System.currentTimeMillis()` (Android) +- `Date.timeIntervalSince()` (iOS) + +All timings are in milliseconds. + +--- + +**See also:** +- [SYSTEM_INVARIANTS.md](./SYSTEM_INVARIANTS.md) — Enforced system invariants +- [docs/progress/03-TEST-RUNS.md](./progress/03-TEST-RUNS.md) — Test run history +