# Script size and page impact

**In short:** the script is about 81 KB compressed, adds about a fiftieth of a second of work around page load on a
desktop (about a quarter of a second on a slow phone), and in our runs added no long task, so visitors see no delay.

> **Note:** Measured 2026-11-03 on the SDK build that was current then (`/sdk/v1.4e6332b8c3548b72.js`). The build
> served now is https://app.trytelltale.dev/sdk/v1.8cefa3306b522996.js, the same one the [Content Security Policy](/docs/csp) page pins; a newer build can differ
> by a few kilobytes. We re-measure after SDK changes.

The hosted script (`/sdk/v1.js`) is what a customer adds to their pages. Telltale **detects AI agents, not several
people sharing one login**; to do that it watches interaction timing and pointer movement, which costs some
main-thread time. This page says how much, measured, so you can judge it yourself.

## Size

| Encoding | Bytes on the wire |
|---|---|
| Brotli (what current browsers get) | **82,955 B (81 KB)** |
| gzip | 97,303 B (95 KB) |
| Uncompressed (after comment stripping) | 321,800 B (314 KB) |

The server compresses once per build at the highest settings (the numbers match Brotli quality 11 and gzip level 9),
sends `/sdk/v1.js` with a 5-minute cache and an ETag, and the versioned `/sdk/v1.<hash>.js` with a one-year immutable
cache, so a returning visitor usually downloads nothing.

## Main-thread time

Headless Chromium 156, Apple M5 Pro, 15 runs each; median (95th percentile). "4x" is Chrome's CPU throttling, a rough
stand-in for a mid-range phone.

| Phase | Desktop (1x): median (95th percentile) | Throttled 4x: median (95th percentile) |
|---|---|---|
| Page load: evaluating the script (parse, compile, run) | **13 ms** (16) | **64 ms** (69) |
| Page load: all SDK work from navigation to 2 s after `load`, including start-up and its first request | **48 ms** (76) | **224 ms** (254) |
| While the visitor moves the pointer, scrolls, clicks and types | **6.7 ms per second** (23) | **25 ms per second** (27) |
| Idle page | **0.8 ms per second** (1.5) | **2.9 ms per second** (6.7) |
| Longest main-thread task during load, with / without the SDK | 21 / 22 ms | 98 / 103 ms |
| Long tasks (> 50 ms) during load, with / without the SDK | 0 / 0 | 2 / 2 |

What this means in plain terms: on a desktop the script adds about a fiftieth of a second of work around page load and
under 1 % of the main thread while someone is using the page. On a slow phone it is about a quarter of a second spread
over the first two seconds, and about 2.5 % of the main thread during active use. In these runs it added **no long
task**: the longest task on the page was the page's own HTML parsing, with or without the SDK. The page didn't report
any errors.

Honest limits: this is one machine and a simple test page, not field data from real visitors. Some desktop runs shared
the CPU with other work on the machine, which is why the 95th percentiles are wide; the medians are the steadier
numbers. Throttling multiplies CPU time but doesn't model a phone's memory or thermal limits. Chromium only, so
Safari and Firefox weren't measured. The script records on page load by default; with `data-telltale-wait-for-consent` it
makes no requests until consent, and that held state wasn't measured separately.

## Method

We start the real Telltale server with a temporary database and a test page (an account-settings page with a text
field, a button and 60 paragraphs), served twice: without the SDK and with the production tag, which records on page
load. Each run uses a fresh, headless and muted Chromium with an empty cache.

- **Size**: `/sdk/v1.js` requested with `Accept-Encoding: br`, `gzip` and `identity`, cross-checked against Brotli 11
  and gzip 9 of the uncompressed bytes.
- **Attribution**: the V8 sampling profiler at 100 µs. A sample counts as SDK time when any frame on its stack comes
  from the SDK script, so the browser APIs the SDK calls are included; work the browser does later on its own (style,
  layout, garbage collection) isn't, which is why the long-task comparison with and without the SDK is shown too.
- **Phases**: load (navigation to 2 s after the `load` event, including the SDK's start request), then 8 s of
  interaction (pointer movement, scrolling, clicking into the field and typing, clicking Save), then 8 s idle.
- **Script evaluation and longest task** come from a separate traced load with no profiler running; **long tasks**
  from a `PerformanceObserver` in the page. Every run is repeated with Chrome's 4x CPU throttling; the tables are the
  medians and 95th percentiles of 15 runs.

Typing in the test happens only to exercise the listeners: the SDK records key timing, never which keys or what was
typed.
