# Benchmarks

The benchmark separates measured data from price ceilings. It never presents a provider cap as an observed charge.

## Existing cloud baseline

These are all five cloud runs available for this Actor before the intelligence release (builds 1.0.31–1.0.32, June 30, 2026). Completeness is `returned items / requested items`. Parent usage excludes this Actor's fee and any separately billed provider Actor.

| Mode           | Runs | Success rate |   Completeness | Median duration | Duration range | Observed parent usage |
| -------------- | ---: | -----------: | -------------: | --------------: | -------------: | --------------------: |
| Comments       |    4 |         100% | 35 / 35 (100%) |         10.98 s |   8.52–38.09 s |       $0.018175 total |
| Profile videos |    1 |         100% |   5 / 5 (100%) |          7.52 s |         7.52 s |       $0.001720 total |

This sample is small and is a baseline, not an availability guarantee. Publish fresh per-mode canaries after deployment before claiming production percentiles.

## Complete price ceiling

The input form exposes the full formula and each provider-backed call receives `maxTotalChargeUsd` based on the remaining user-selected cap.

| Preset example                 | Actor fee ceiling | Provider ceiling |                         Complete maximum |
| ------------------------------ | ----------------: | ---------------: | ---------------------------------------: |
| Compare 2 creators × 50 videos |            $0.055 |    user-selected |                             $0.055 + cap |
| Analyze 100 competitor videos  |            $0.055 |    user-selected |                             $0.055 + cap |
| Research 250 comments          |            $0.255 |    user-selected |                             $0.255 + cap |
| 100 native profiles or videos  |            $0.105 |               $0 | $0.105 plus platform usage while enabled |

The exact calculated ceiling is also saved as `COST_ESTIMATE.json` on every run. Provider-backed modes cannot exceed the configured provider ceiling.

## Local analytics-layer benchmark

Run `npm run build && node scripts/benchmark-intelligence.mjs`. The harness performs 25 iterations for each sample size and reports median and p95 calculation time. It measures derived analytics only—not TikTok network collection.

Measured July 19, 2026 on the local development machine:

| Videos analyzed | Iterations |    Median |       p95 |
| --------------: | ---------: | --------: | --------: |
|             100 |         25 |   4.03 ms |   4.82 ms |
|           1,000 |         25 |  37.82 ms |  65.08 ms |
|          10,000 |         25 | 411.50 ms | 430.37 ms |

## Release benchmark protocol

For each public preset, run at least 20 scheduled canaries over seven days and publish:

- p50 and p95 duration;
- successful runs divided by attempted runs;
- returned records divided by requested records;
- Actor fee, provider charge, and platform usage as separate columns plus their sum;
- build number, date range, region, sample size, and any excluded user-input failures.

Do not compare competitors until the same inputs, result definition, region, and retry policy can be used.
