zed/crates/miniprofiler_ui
Kirill Bulatov fca4d60ce1
Disable miniprofiler by default (#54645)
Needs https://github.com/zed-industries/zed/pull/54635 for the profile
overrides added into default settings json to work.
Part of https://github.com/zed-industries/zed/issues/48968
Another part of the fix related seems to be
https://github.com/zed-industries/zed/pull/45669 ?

Using the steps from the issue and profiling on macOs had shown that Zed
has 2 memory "leaks" in play when a certain file is being rewritten a
lot of times.

* First, the thread profiler registers a lot of tasks' data and fills
its buffer to the limit:

<img width="3456" height="2158" alt="image"
src="https://github.com/user-attachments/assets/f183312d-4389-4072-8915-d54e60419b08"
/>

* Second, if the buffer gets open, the undo history fragments start to
creep up infinitely:

<img width="3456" height="2158" alt="image"
src="https://github.com/user-attachments/assets/61a2b66b-81fd-4973-9c3c-c339f886d9b2"
/>

The PR aims to solve the first issue by disabling the profiling by
default, yet leaving the way to turn in on quickly with settings.

The memory usage profiling shows that the memory usage is now
dynamically affected by the new setting:

<img width="2032" height="1136" alt="image"
src="https://github.com/user-attachments/assets/8a6c76b9-6fb7-44bc-ac1d-3c34afe7c575"
/>

While the test directory being thrashed with the script from the issue, 
* first, Zed starts with the profiling disabled
* then gets the profiling enabled which results in the memory growth
close to 1 minute mark of the screenshot
* last, the profiling gets disabled again, releasing all the memory
accumulated

Release Notes:

- Improved Zed's default memory usage
2026-04-23 18:41:52 +00:00
..
src Disable miniprofiler by default (#54645) 2026-04-23 18:41:52 +00:00
Cargo.toml Disable miniprofiler by default (#54645) 2026-04-23 18:41:52 +00:00
LICENSE-GPL