gpui: Clear the element arena after presenting the frame (#33338)

This is an easy way to shave some microseconds off the critical path for
frame rendering. On my machine this reduces typical frame rendering
latency by ~100 microseconds, probably quite a bit more on slower
machines.

Here is how long it typically takes to drop elements from the arena,
from a fairly brief run:


![image](https://github.com/user-attachments/assets/65cfd911-eccf-4393-887d-8cad2cd27148)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-06-24 13:43:33 -06:00 committed by GitHub
parent eec26c9a41
commit 9427526a41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 12 deletions

View file

@ -2199,7 +2199,7 @@ impl Workspace {
// (Note that the tests always do this implicitly, so you must manually test with something like:
// "bindings": { "g z": ["workspace::SendKeystrokes", ": j <enter> u"]}
// )
window.draw(cx);
window.draw(cx).clear();
}
})?;
}