Skip to content

Log worst hanging tasks and actions - #57835

Merged
yara-blue merged 13 commits into
mainfrom
perf-task-telemetry
Jun 2, 2026
Merged

Log worst hanging tasks and actions#57835
yara-blue merged 13 commits into
mainfrom
perf-task-telemetry

Conversation

@yara-blue

@yara-blue yara-blue commented May 27, 2026

Copy link
Copy Markdown
Contributor

We have a lot of long blocking tasks on both the foreground and background, this is a start of getting some insight into those.

We will now log tasks running longer then 100ms on the foreground or background. Hanging actions will also be logged including their name. We simultaneously collect statistics on task and action performance and send those to telemetry. This includes quantiles and averages for each hanging task.

Finally this adds tree dev actions:

  • hang action
  • hang foreground
  • hang background

These cause a hang to check if hang reporting is working and in the future telemetry.

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

Closes #ISSUE

Release Notes:

  • Added logging and telemetry of tasks and actions with performance issues

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 27, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label May 27, 2026
.collect::<Vec<_>>();

if event.need_rescan() {
if !watcher_logging_rate_limited() {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note for reviewer: This got rather spammy when the app hangs hiding hang detection reports. For now just ratelimitted this specific log, we should probably add ratelimiting & deduplication to all our logging.

@yara-blue yara-blue changed the title Log worst hanging tasks and actions. Log worst hanging tasks and actions May 27, 2026
@yara-blue
yara-blue force-pushed the perf-task-telemetry branch 3 times, most recently from 9fd8afe to a2f2370 Compare May 28, 2026 14:56
@yara-blue

yara-blue commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

There are some unnamed actions (internally used for example by vim). Do we want to track their location and report them too? I would say yes but after setting up telemetry.

@yara-blue

yara-blue commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

This makes Zed ~0.1% slower, which I deem acceptable.

image

@yara-blue
yara-blue force-pushed the perf-task-telemetry branch from a2f2370 to 44584d4 Compare June 1, 2026 10:35
yara-blue added 10 commits June 1, 2026 12:59
We have a lot of long blocking tasks on both the foreground and
background, this is a start of getting some insight into those.

In principle we should report every item taking longer then a
millisecond however that would cause a lot of reports right now. As the
app gets better we can lower this bound.

Will be followed up with a PR sending these to telemetry and adding a
setting to control when tasks get reported.

Finally this adds tree dev actions: 
- hang action
- hang foreground
- hang background

These cause a hang to check if hang reporting is working and in the
future telemetry

add dev action to hang the executor
@yara-blue
yara-blue force-pushed the perf-task-telemetry branch from 44584d4 to 44008ba Compare June 1, 2026 10:59
@yara-blue
yara-blue requested a review from MrSubidubi June 1, 2026 15:49
@yara-blue
yara-blue force-pushed the perf-task-telemetry branch from 1806dea to 2efbdfa Compare June 2, 2026 11:47
@yara-blue
yara-blue force-pushed the perf-task-telemetry branch from 2efbdfa to 076a63b Compare June 2, 2026 11:52
@yara-blue
yara-blue enabled auto-merge June 2, 2026 11:55
@yara-blue
yara-blue added this pull request to the merge queue Jun 2, 2026
Merged via the queue into main with commit 39f7849 Jun 2, 2026
32 checks passed
@yara-blue
yara-blue deleted the perf-task-telemetry branch June 2, 2026 12:05
@Anthony-Eid

Copy link
Copy Markdown
Contributor

This makes Zed ~0.1% slower, which I deem acceptable.

Is this still blocked by a setting? I think it's acceptable for Zed, but as GPUI is a general app framework there should be a way to disable it

@yara-blue

Copy link
Copy Markdown
Contributor Author

Is this still blocked by a setting? I think it's acceptable for Zed, but as GPUI is a general app framework there should be a way to disable it

mhm fair point. Could make it a feature. Though this slowdown was already there with the profiler, so I'd not say it's really urgent.

@Anthony-Eid

Copy link
Copy Markdown
Contributor

Agreed, I'm working on more gpui dev tooling at the moment so we should eventually have this be under a feature. I haven't looked at the code either but I would like to unify a lot of this the histogram latency tracker we have as well

TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request Jun 8, 2026
We have a lot of long blocking tasks on both the foreground and
background, this is a start of getting some insight into those.

We will now log tasks running longer then 100ms on the foreground or
background. Hanging actions will also be logged including their name. We
simultaneously collect statistics on task and action performance and
send those to telemetry. This includes quantiles and averages for each
hanging task.

Finally this adds tree dev actions: 
- hang action
- hang foreground
- hang background

These cause a hang to check if hang reporting is working and in the
future telemetry.

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

Closes #ISSUE

Release Notes:

- Added logging and telemetry of tasks and actions with performance
issues
This was referenced Jun 18, 2026
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
We have a lot of long blocking tasks on both the foreground and
background, this is a start of getting some insight into those.

We will now log tasks running longer then 100ms on the foreground or
background. Hanging actions will also be logged including their name. We
simultaneously collect statistics on task and action performance and
send those to telemetry. This includes quantiles and averages for each
hanging task.

Finally this adds tree dev actions: 
- hang action
- hang foreground
- hang background

These cause a hang to check if hang reporting is working and in the
future telemetry.

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

Closes #ISSUE

Release Notes:

- Added logging and telemetry of tasks and actions with performance
issues
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
We have a lot of long blocking tasks on both the foreground and
background, this is a start of getting some insight into those.

We will now log tasks running longer then 100ms on the foreground or
background. Hanging actions will also be logged including their name. We
simultaneously collect statistics on task and action performance and
send those to telemetry. This includes quantiles and averages for each
hanging task.

Finally this adds tree dev actions: 
- hang action
- hang foreground
- hang background

These cause a hang to check if hang reporting is working and in the
future telemetry.

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

Closes #ISSUE

Release Notes:

- Added logging and telemetry of tasks and actions with performance
issues
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.

3 participants