# Performance

> Find slow and large responses, missing compression, duplicate requests, N+1 bursts, uncacheable static files and failing endpoints in captured traffic.

Source: https://docs.subcloak.com/cloak-proxy/insights/performance/

The **Performance** tab points out where an app wastes time or bandwidth: slow endpoints, very large responses, text sent without compression, the same request sent over and over, N+1 loops that fetch one item per call, static files that can't be cached, and endpoints that fail. Each finding is grouped by endpoint or host, so one slow API is one line, not a hundred.

*[Screenshot: The Performance tab with filter chips for each kind and a list of findings: a slow search endpoint, two failing endpoints, an N+1 burst of 14 review requests, uncacheable and uncompressed files on a CDN, and a duplicate request. Findings are sorted by severity, then by how much they cost.]*

## Review findings

1. Open Insights with <kbd>⌥</kbd> <kbd>⌘</kbd> <kbd>I</kbd> and click **Performance**.
2. Click a chip to show one kind of finding. **All** shows everything. Only kinds with at least one finding get a chip, and each chip shows its count.
3. Read each finding: its kind, severity, the endpoint or host it's about, and a one-line explanation with the numbers.
4. Click **Show Request** (or **Show N Requests**) to select the requests behind it in the main window.

Findings are sorted by severity, then by impact: the worst time, the most bytes or the most requests. When nothing is found, the tab says **Nothing to improve**.

## Every kind of finding

| Kind | Grouped by | Reported when | Severity |
|---|---|---|---|
| **Slow** | Endpoint | A response took 1 second or more. The detail shows how many, the average and the worst. | High if the worst took 3 seconds or more, otherwise Medium |
| **Large** | Endpoint | A response body is 1 MB (1,000,000 bytes) or larger. | High if one is 10 MB or larger, otherwise Medium |
| **Uncompressed** | Host | A text response of 10,000 bytes or more has no `Content-Encoding`. Text means a `Content-Type` containing `json`, `html`, `javascript`, `css`, `xml`, `text/`, `graphql` or `svg`. | Medium if the host's uncompressed responses total 1 MB or more, otherwise Low |
| **Duplicate** | Method, full URL and body | The identical request was sent 3 or more times within 10 seconds. | Medium if 10 or more, otherwise Low |
| **Burst** | Endpoint template | 10 or more calls to one templated endpoint (a path with a placeholder such as `{id}`) within 2 seconds. This is the usual sign of an N+1 loop. | Medium |
| **Not cacheable** | Host | A `GET` for an image, stylesheet, script or font returned `200` with none of `Cache-Control`, `ETag`, `Last-Modified` or `Expires`. | Low |
| **Errors** | Endpoint | A request failed with no response, or the response was a 5xx. The detail lists the status codes, or `no response`. | High |

"Endpoint" means the same grouping as the [Endpoints](https://docs.subcloak.com/cloak-proxy/insights/endpoints/) tab: method, host and templated path, so `/v1/reviews/100` and `/v1/reviews/101` count together.

### What each finding tells you

| Kind | Example detail | What to do |
|---|---|---|
| **Slow** | `3× over 1.0 s, average 2.1 s, worst 3.4 s` | Profile the endpoint, add caching, or paginate. |
| **Large** | `2× up to 4.2 MB` | Trim fields, paginate, or compress. |
| **Uncompressed** | `12 text responses (2.4 MB) sent without compression; gzip or brotli usually saves 70–90%` | Turn on gzip or Brotli on the server or CDN. |
| **Duplicate** | `Sent 4 times within 10.0 s with the same body. Cache or deduplicate it.` | Cache the result in the app, or share one in-flight request. |
| **Burst** | `14 calls within 2.0 s, one per item. A batch endpoint would need one.` | Add a batch or list endpoint and fetch everything at once. |
| **Not cacheable** | `2 static files (31 KB) have no Cache-Control, ETag or Last-Modified` | Add caching headers so files aren't downloaded on every visit. |
| **Errors** | `1 failed (503)` | Open the request and check the server logs. |

Sizes are the size of the body as it was sent, before Cloak Proxy decodes it. Durations are measured from when the request started to when the response finished.

### What's left out

- Duplicate and burst detection skip `CONNECT` requests and undecrypted tunnels.
- Burst detection only counts API calls: images, stylesheets, JavaScript, fonts and media are skipped, and the path must contain a placeholder.
- Slow, large, uncompressed and not-cacheable checks only look at requests that got a response.

The thresholds are fixed. To test how your app behaves on a slow connection rather than finding slow servers, use [Network Conditions](https://docs.subcloak.com/cloak-proxy/tools/network-conditions/).

> **Narrow it to one app:**
> Set the scope menu at the top of the window to **Current filter**, then select an app in the main window's sidebar. The Performance tab then only shows problems in that app's traffic.

## Performance in the report and over MCP

The Markdown report lists up to 50 findings with their kind, title and detail. The MCP server's `insights` tool returns them with `section` set to `performance`. See [Insights report](https://docs.subcloak.com/cloak-proxy/insights/report/).

## Related

  - [Timeline](https://docs.subcloak.com/cloak-proxy/insights/timeline/): See slow requests and gaps on one time axis.
  - [Endpoints](https://docs.subcloak.com/cloak-proxy/insights/endpoints/): p50 and p95 latency for every endpoint.
  - [Test on a slow network](https://docs.subcloak.com/cloak-proxy/guides/test-on-a-slow-network/): Simulate bad connections with Network Conditions.
  - [Alerts](https://docs.subcloak.com/cloak-proxy/tools/alerts/): Get a notification when an endpoint slows down or fails.
