> ## Documentation Index
> Fetch the complete documentation index at: https://codspeed.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting up Continuous Performance Checks

> Learn how to enable performance safeguards in your project

CodSpeed provides a performance **status check** to your branches and pull
requests. The status of this check is based on the performance change between
the current branch and your main branch (and the project's
[regression threshold](/features/customization#regression-threshold)).

You can configure the performance check to fail if the performance metrics of a
branch or pull request are overshooting your regression threshold. Thus,
**blocking the pull request** from being merged if the performance issue is
neither fixed nor [acknowledged](#acknowledge-regressions-or-benchmark-drops).

## Setup performance checks

<Steps>
  <Step title="Access repository settings">
    Once your project has run at least one benchmark, go to your repository's settings on GitHub.
  </Step>

  <Step title="Navigate to branch protection">
    Under the **Code and automation** section, open the **Branches** tab.
  </Step>

  <Step title="Configure branch protection rule">
    Add a new branch protection rule or update the one already protecting your
    main branch.
  </Step>

  <Step title="Set branch name pattern">
    <Frame caption="In the branch name pattern field, enter the name of your default branch">
      <img src="https://mintcdn.com/codspeed/jKaxX6yy-Kzw1C-0/features/performance-checks/assets/branch-name-pattern.png?fit=max&auto=format&n=jKaxX6yy-Kzw1C-0&q=85&s=36d03a48636c6c2e371154a9ebe7a255" className="rounded-xl w-full max-w-lg mx-auto" alt="Set the branch name pattern" width="1086" height="310" data-path="features/performance-checks/assets/branch-name-pattern.png" />
    </Frame>
  </Step>

  <Step title="Enable status checks requirement">
    Tick the **Require status checks to pass before merging** checkbox.
  </Step>

  <Step title="Add CodSpeed status check">
    Under this section, search for **CodSpeed Performance Analysis** and click on the item to enable the check:

    <Frame>
      <img src="https://mintcdn.com/codspeed/jKaxX6yy-Kzw1C-0/features/performance-checks/assets/status-check-configuration.png?fit=max&auto=format&n=jKaxX6yy-Kzw1C-0&q=85&s=cf1b4cd4aa386daad367d23753be2e98" className="rounded-xl w-full max-w-lg mx-auto" alt="Configuration of the status check" width="1172" height="718" data-path="features/performance-checks/assets/status-check-configuration.png" />
    </Frame>
  </Step>

  <Step title="Save changes">
    **Save the changes** and you're done! 🎉 Your performance checks are now
    configured and will run on future pull requests, preventing you from merging
    pull requests that introduce performance regressions.

    <Frame caption="Pull Request Checks failing because of the performance regression">
      <img src="https://mintcdn.com/codspeed/q5Q3QnyKsjTld2tv/assets/quickstart-regression-checks.png?fit=max&auto=format&n=q5Q3QnyKsjTld2tv&q=85&s=cafac36f9a791d06187e998b6ee8d6d7" alt="Pull Request Checks failing because of the performance regression" className="w-full max-w-lg mx-auto" width="831" height="184" data-path="assets/quickstart-regression-checks.png" />
    </Frame>
  </Step>
</Steps>

## Acknowledge regressions or benchmark drops

If you're aware of performance issues that are not yet fixed or were totally
intentional, you can acknowledge them to **prevent the performance check from
failing**.

<Note>
  **Acknowledgement Permission**: When working with an organization's
  repository, **only admins** are allowed to acknowledge regressions.
</Note>

Once all the regressions are fixed or acknowledged, the performance check will
pass and you can safely merge your pull request while being **aware of your
performance issues**.

### Acknowledge a single benchmark

First, head to the CodSpeed report (you can access it from the link in the
inline performance report or directly from your
[CodSpeed Dashboard](https://app.codspeed.io/dashboard)).

Then, go to the regressed benchmark you want to acknowledge:

<img src="https://mintcdn.com/codspeed/03672jtP0I3gWCvv/features/performance-checks/assets/failing-benchmark.png?fit=max&auto=format&n=03672jtP0I3gWCvv&q=85&s=e0bf7a717b3f1b610f019b6baee49b11" className="rounded-xl w-full max-w-xl mx-auto" alt="failing benchmark" width="1261" height="104" data-path="features/performance-checks/assets/failing-benchmark.png" />

Click on the the benchmark to expand its content:

<Frame>
  <img src="https://mintcdn.com/codspeed/03672jtP0I3gWCvv/features/performance-checks/assets/expanded-benchmark.png?fit=max&auto=format&n=03672jtP0I3gWCvv&q=85&s=e28452f1e23a027aec788b3136ab4941" className="rounded-xl w-full max-w-xl mx-auto" alt="Expanded benchmark" width="1262" height="359" data-path="features/performance-checks/assets/expanded-benchmark.png" />
</Frame>

Click on the "Acknowledge regression" button and that's it 🎉 :

<img src="https://mintcdn.com/codspeed/03672jtP0I3gWCvv/features/performance-checks/assets/acknowledged-benchmark.png?fit=max&auto=format&n=03672jtP0I3gWCvv&q=85&s=016dd5f94d693cdec57bce35fc7a3d9b" className="rounded-xl w-full max-w-xl mx-auto" alt="Acknowledged benchmark" width="1251" height="115" data-path="features/performance-checks/assets/acknowledged-benchmark.png" />

### Acknowledge multiple benchmarks

To acknowledge multiple benchmarks at once:

Filter the benchmark list to show only regressions using the **Status** filter
or by typing `is:regression` in the search bar:

<img src="https://mintcdn.com/codspeed/yDUzQZhwEA7SNuSf/features/performance-checks/assets/acknowledge-multiple.png?fit=max&auto=format&n=yDUzQZhwEA7SNuSf&q=85&s=775a6368d32799445c64f0f8b44df31a" className="rounded-xl w-full max-w-xl mx-auto" alt="Acknowledge multiple benchmarks" width="1293" height="898" data-path="features/performance-checks/assets/acknowledge-multiple.png" />

Select the benchmarks you want to acknowledge using the checkboxes:

<img src="https://mintcdn.com/codspeed/03672jtP0I3gWCvv/features/performance-checks/assets/acknowledge-selected.png?fit=max&auto=format&n=03672jtP0I3gWCvv&q=85&s=f2f60b5e560e5e5b4098e148097a55cd" className="rounded-xl w-full max-w-xl mx-auto" alt="Acknowledge selected benchmarks" width="1304" height="893" data-path="features/performance-checks/assets/acknowledge-selected.png" />

Click the **Acknowledge selected** button that appears in the list header and
that's it 🎉 :

<img src="https://mintcdn.com/codspeed/03672jtP0I3gWCvv/features/performance-checks/assets/acknowledged-multiple-benchmarks.png?fit=max&auto=format&n=03672jtP0I3gWCvv&q=85&s=463092efb39102d6db5c7234d6ea8ca3" className="rounded-xl w-full max-w-xl mx-auto" alt="Acknowledged multiple benchmarks" width="1299" height="901" data-path="features/performance-checks/assets/acknowledged-multiple-benchmarks.png" />

## Understanding Performance Regressions

<Columns cols={2}>
  <Card title="How Performance Metrics Work" href="/features/understanding-the-metrics" icon="chart-line">
    Learn how CodSpeed calculates performance impact and regression thresholds
  </Card>

  <Card title="Debug with Flame Graphs" href="/features/profiling" icon="bars-sort">
    Use detailed profiling data to identify and fix performance bottlenecks
  </Card>
</Columns>

## Related Guides

<Columns cols={2}>
  <Card title="Configure Regression Thresholds" href="/features/customization" icon="gear">
    Customize when performance changes trigger failures
  </Card>

  <Card title="CI Integration Setup" href="/integrations/ci" icon="server">
    Set up CodSpeed in your continuous integration pipeline
  </Card>
</Columns>
