Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(tui): only rerender if a non-tick event has been received (#9121)
### Description `ratatui` does a great job of only updating cells that are different between render, but constructing the `vt100` screen can be intensive. This PR avoid constructing the screen if there are no updates to the the app state meaning there's no reason to re-render the TUI. There are some additional changes we can also make to lower CPU usage more: - We're currently spending a lot of time polling for terminal events see if there's a less resource intensive alternative. - Patch vt100 so constructing `Screen` is less resource intensive e.g. doy/vt100-rust#14 ### Testing Instructions Using TUI in [next.js](https://github.com/vercel/next.js) ``` pnpm dev -F next ``` Before <img width="302" alt="Screenshot 2024-09-06 at 12 40 07 PM" src="https://github.com/user-attachments/assets/698595a0-f02e-4ef0-8880-ab39a6ecf32c"> After Ran via `cargo build -p turbo --release` and `turbo_dev --skip-infer dev -F next` <img width="292" alt="Screenshot 2024-09-06 at 12 31 00 PM" src="https://github.com/user-attachments/assets/66859912-7cea-4180-8c5e-10ea32312c52">
- Loading branch information