validation and profiles

This commit is contained in:
Miha Kralj
2026-02-26 22:02:52 -08:00
parent 9ab37c1200
commit 8a1ba95173
317 changed files with 18704 additions and 622 deletions
+14
View File
@@ -61,6 +61,20 @@ $$ M_n = \frac{1}{n} \sum_{i=1}^{n} x_i = \frac{(n-1) \cdot M_{n-1} + x_n}{n} $$
## Performance Profile
### Operation Count (Streaming Mode)
Cumulative Mean Arithmetic uses a simple running sum divided by count — no window, no buffer.
| Operation | Count | Cost (cycles) | Subtotal |
| :--- | :---: | :---: | :---: |
| Add value to running sum | 1 | 1 cy | ~1 cy |
| Increment count | 1 | 1 cy | ~1 cy |
| Divide sum by count | 1 | 4 cy | ~4 cy |
| NaN guard + state update | 1 | 2 cy | ~2 cy |
| **Total** | **O(1)** | — | **~8 cy** |
Cheapest mean variant — no buffer, no window management. Throughput limited by division latency (~4 cy on modern x86).
| Metric | Score | Notes |
| :--- | :--- | :--- |
| **Throughput** | ~5 ns/bar | Single division per update. |