Skip to content

gpui: Add bare bones benchmark framework - #58191

Merged
Anthony-Eid merged 6 commits into
mainfrom
bench-app-context
Jun 1, 2026
Merged

gpui: Add bare bones benchmark framework#58191
Anthony-Eid merged 6 commits into
mainfrom
bench-app-context

Conversation

@Anthony-Eid

Copy link
Copy Markdown
Contributor

Summary

Adds the first pass at #[gpui::bench], backed by Criterion, with a new BenchAppContext for GPUI benchmarks.

This ports one editor benchmark to the new setup while keeping the existing Criterion render benchmarks in place.

Follow Ups

I eventually want to improve this framework to create custom tracy profiles that includes additional information such as

  • notify count
  • entity.update count and time
  • event emitted and time for that

I also want to use this to create custom measurements so benches can be used for

  • Frames dropped
  • foreground thread time
  • Render time
  • etc

This PR is a very small proof of initial concept and I'll continue to build this infrastructure out so Zed and other gpui apps can become a lot more resilient to dropping frames and hangs. Plus it will make improving performance a lot easier as well in the future.

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • N/A

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 1, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Jun 1, 2026
@maxdeviant maxdeviant changed the title gpui: Add bare bones gpui benchmark framework gpui: Add bare bones benchmark framework Jun 1, 2026
@MartinYe1234
MartinYe1234 self-requested a review June 1, 2026 22:19
@Anthony-Eid
Anthony-Eid added this pull request to the merge queue Jun 1, 2026
Merged via the queue into main with commit aa6f03b Jun 1, 2026
34 checks passed
@Anthony-Eid
Anthony-Eid deleted the bench-app-context branch June 1, 2026 22:31
TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request Jun 2, 2026
### Summary

Adds the first pass at `#[gpui::bench]`, backed by Criterion, with a new
`BenchAppContext` for GPUI benchmarks.

This ports one editor benchmark to the new setup while keeping the
existing Criterion render benchmarks in place.

### Follow Ups

I eventually want to improve this framework to create custom tracy
profiles that includes additional information such as
- notify count
- entity.update count and time
- event emitted and time for that

I also want to use this to create custom measurements so benches can be
used for
- Frames dropped 
- foreground thread time
- Render time
- etc


This PR is a very small proof of initial concept and I'll continue to
build this infrastructure out so Zed and other gpui apps can become a
lot more resilient to dropping frames and hangs. Plus it will make
improving performance a lot easier as well in the future.


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
This was referenced Jun 18, 2026
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
### Summary

Adds the first pass at `#[gpui::bench]`, backed by Criterion, with a new
`BenchAppContext` for GPUI benchmarks.

This ports one editor benchmark to the new setup while keeping the
existing Criterion render benchmarks in place.

### Follow Ups

I eventually want to improve this framework to create custom tracy
profiles that includes additional information such as
- notify count
- entity.update count and time
- event emitted and time for that

I also want to use this to create custom measurements so benches can be
used for
- Frames dropped 
- foreground thread time
- Render time
- etc


This PR is a very small proof of initial concept and I'll continue to
build this infrastructure out so Zed and other gpui apps can become a
lot more resilient to dropping frames and hangs. Plus it will make
improving performance a lot easier as well in the future.


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
### Summary

Adds the first pass at `#[gpui::bench]`, backed by Criterion, with a new
`BenchAppContext` for GPUI benchmarks.

This ports one editor benchmark to the new setup while keeping the
existing Criterion render benchmarks in place.

### Follow Ups

I eventually want to improve this framework to create custom tracy
profiles that includes additional information such as
- notify count
- entity.update count and time
- event emitted and time for that

I also want to use this to create custom measurements so benches can be
used for
- Frames dropped 
- foreground thread time
- Render time
- etc


This PR is a very small proof of initial concept and I'll continue to
build this infrastructure out so Zed and other gpui apps can become a
lot more resilient to dropping frames and hangs. Plus it will make
improving performance a lot easier as well in the future.


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants