# Improve terminal rendering performance \(\#33345\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/925464cfc6cb26f2576816f8f02bbf7044e9f41b)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 925464cfc6cb26f2576816f8f02bbf7044e9f41b

Requested commit: 925464cfc6cb26f2576816f8f02bbf7044e9f41b

Commit: 925464cfc6cb26f2576816f8f02bbf7044e9f41b

Tree: 6269eabe5ccd45df88eb4ec56e9dca7bcb4f4c67

Author: Alisina Bahadori

Committer: GitHub

## Message

```
Improve terminal rendering performance (#33345)

Closes #18263

Improvements:

• **Batch text rendering** - Combine adjacent cells with identical
styling into single text runs to reduce draw calls
• **Throttle hyperlink searches** - Limit hyperlink detection to every
100ms or when mouse moves >5px to reduce CPU usage
• **Pre-allocate collections** - Use `Vec::with_capacity()` for cells,
runs, and regions to minimize reallocations
• **Optimize background regions** - Merge adjacent background rectangles
to reduce number of draw operations
• **Cache selection text** - Only compute terminal selection string when
selection exists

Release Notes:

- Improved terminal rendering performance.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
```

## Parents

- [bcac748c2bc4aaa25bda987ce1c42e17f2c9a18d](https://git.cafe/gitcafe/zed/commit/bcac748c2bc4aaa25bda987ce1c42e17f2c9a18d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/925464cfc6cb26f2576816f8f02bbf7044e9f41b?format=markdown)
