Files
oak-gpui/crates
Piotr Osiewicz 226ec9d404 gpui: Fix performance of app menu opening with large # of windows (#16939)
This is officially my weirdest performance fix to date; With large # of
windows opening app menu could take a lot of time (we're talking few
seconds with 9 windows, a minute with 10 windows). The fix is to make
one method pub(crate).. What?

<img width="981" alt="image"
src="https://github.com/user-attachments/assets/83b26154-0acd-43ef-84b3-4b85cde36120">

We were spending most of the time on clear_pending_keystrokes, which -
funnily enough - called itself recursively. It turned out we have two
methods; `AppContext::clear_pending_keystrokes` and
WindowContext::clear_pending_keystrokes. The former calls the latter,
but - due to the fact that `WindowContext::clear_pending_keystrokes` is
private and `WindowContext` derefs to `AppContext` - `AppContext` one
ended up actually calling itself! The fix is plain and simple - marking
WindowContext one as pub(crate), so that it gets picked up as a method
to call over `AppContext::clear_pending_keystrokes`.

Closes #16895



Release Notes:

- Fixed app menu performance slowdowns when there are multiple windows
open.
2024-08-27 12:23:00 +02:00
..
2024-05-29 18:06:45 -07:00
2024-07-23 15:01:05 -07:00
2024-08-26 14:47:02 -06:00
2024-04-30 23:31:59 -06:00
2024-08-13 23:06:07 -07:00
2024-03-11 10:45:57 +01:00
2024-07-15 17:04:15 -06:00
2024-08-26 14:47:02 -06:00
2024-08-26 14:47:02 -06:00
2024-08-26 18:03:06 -07:00
2024-08-26 14:47:02 -06:00
2024-08-09 13:37:54 -04:00
2024-04-15 14:21:52 +02:00
2024-08-16 10:09:38 -07:00