Skip to content

editor: Improve colorize_bracket highlight performance (#49803) (cherry-pick to preview)#49808

Merged
zed-zippy[bot] merged 1 commit intov0.225.xfrom
cherry-pick-v0.225.x-5e3efc64
Feb 21, 2026
Merged

editor: Improve colorize_bracket highlight performance (#49803) (cherry-pick to preview)#49808
zed-zippy[bot] merged 1 commit intov0.225.xfrom
cherry-pick-v0.225.x-5e3efc64

Conversation

@zed-zippy
Copy link
Contributor

@zed-zippy zed-zippy bot commented Feb 21, 2026

Cherry-pick of #49803 to preview


The binary search insertion scheme in highlight_text works fine for
small numbers of elements but does not handle large amounts of ranges
well, as that will cause constant memcpying of the latter half of the
vec. Bracket colorization tends to have a huge amount of entries though,
so this can cause massive lags on the foreground thread. The better
approach here is to just collect all elements and re-sort them once.

Release Notes:

  • Reduced mini-stutters occuring due to large amount of bracket
    colorization in big buffers and agent diffs

The binary search insertion scheme in `highlight_text` works fine for
small numbers of elements but does not handle large amounts of ranges
well, as that will cause constant memcpying of the latter half of the
vec. Bracket colorization tends to have a huge amount of entries though,
so this can cause massive lags on the foreground thread. The better
approach here is to just collect all elements and re-sort them once.

Release Notes:

- Reduced mini-stutters occuring due to large amount of bracket
colorization in big buffers and agent diffs
@zed-zippy zed-zippy bot requested review from a team as code owners February 21, 2026 14:41
@zed-zippy zed-zippy bot requested review from ConradIrwin and mattermill and removed request for a team February 21, 2026 14:41
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 21, 2026
@zed-zippy zed-zippy bot requested review from cole-miller and dinocosta and removed request for a team February 21, 2026 14:41
@zed-community-bot zed-community-bot bot added the bot Pull requests authored by a bot label Feb 21, 2026
@zed-zippy zed-zippy bot merged commit ca31469 into v0.225.x Feb 21, 2026
37 checks passed
@zed-zippy zed-zippy bot deleted the cherry-pick-v0.225.x-5e3efc64 branch February 21, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot Pull requests authored by a bot cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant