---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://perfloop.ai/.well-known/search?q={query}"
  method: "GET"
---

situation

# Catch slow code before it merges

Perfloop reviews new pull requests in the repos you select. For a pull request from a branch in the same repo, the review runs workloads that exercise the changed code, such as the repo's benchmarks, on the base commit and on the head commit, and compares the results. It posts the problems a run of the changed code proved as a review on the pull request. Perfloop cannot fail a check or request changes, so your CI and your reviewers keep the merge decision.

## The workflow

1. Connect your repos in Setup.
2. In **Setup → Automatic work**, an Admin sets **PR review** to **First push** or **Every push** for a repo. It is off by default.
3. Perfloop posts a comment-only review. A finding on lines the pull request changed is a comment on those lines. Select **Open in Perfloop** on a finding to open its Case, and **Work this case** there to test it at the reviewed commit.
4. Your coding agent can measure any pull request in a selected repo, even with PR review off: it calls `submitDiff` with `measure: true` through the MCP server.

On GitHub.com, for a pull request from a fork, someone with write access first adds a 👍 to Perfloop's comment on the exact commit, because the review runs the contributor's build and test code. Reviews use Usage. [Connect GitHub](https://perfloop.ai/docs/connect/github) and [Autonomy and limits](https://perfloop.ai/docs/work/autonomy) explain each setting.

The measurements cover only the workloads Perfloop ran.

## Public Cases

Perfloop found and fixed these in code already on each repo's main branch.

- [lz4, Go](https://app.perfloop.ai/t/oss/case_7yz78wmqmc): shortening the amd64 decoder's shortcut loop reduced the `BenchmarkUncompress` time from 211.6 µs to 174.7 µs per op. Verified and merged upstream.
- [distribution, Go](https://app.perfloop.ai/t/oss/case_p6h3vmsws2): cold opens of small blobs no longer allocate a full-size buffer. Bytes allocated per download fell from 4,195,868 to 4,943. Verified and merged upstream.

## What it cannot do

Perfloop opens pull requests, or an issue when a result suits one better. It cannot approve, merge, or deploy. A proven result opens nothing until a member selects **Allow & open PR** or **Allow & open issue** in Inbox, unless an Admin set that repo's **Pull requests** control to **Open**. When your repo's rules hold a result, the hold shows on its Case page instead. A hypothesis the evidence disproves stays on its Case as refuted. Start with the [Quickstart](https://perfloop.ai/docs/work/quickstart).
