Skip to content

editor: Reduce amount of sumtree traversals in header_and_footer_blocks#43709

Merged
Veykril merged 1 commit intomainfrom
push-zqvryxonwltl
Nov 28, 2025
Merged

editor: Reduce amount of sumtree traversals in header_and_footer_blocks#43709
Veykril merged 1 commit intomainfrom
push-zqvryxonwltl

Conversation

@Veykril
Copy link
Member

@Veykril Veykril commented Nov 28, 2025

Introduces new "mapping point cursors" for the different display map layers allowing one to map multiple points in increasing order more efficiently than using the one shot operations.

This is used in the BlockMap::sync for header_and_footer_blocks which spends a significant time in sumtree traversal due to repeatedly transforming points between the different layers. This effectively turns the complexity of those operations from quadratic in the number of excerpts to linear, as we only go through the respective sumtrees once instead of restarting from the start over and over again.

Release Notes:

  • Improved performance for editors of large multibuffers with many different files

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 28, 2025
@Veykril Veykril changed the title Reduce amount of sumtree traversals in header_and_footer_blocks editor: Reduce amount of sumtree traversals in header_and_footer_blocks Nov 28, 2025
@Veykril Veykril merged commit 8f8a92c into main Nov 28, 2025
23 checks passed
@Veykril Veykril deleted the push-zqvryxonwltl branch November 28, 2025 08:07
11happy pushed a commit to 11happy/zed that referenced this pull request Dec 1, 2025
…cks` (zed-industries#43709)

Introduces new "mapping point cursors" for the different display map
layers allowing one to map multiple points in increasing order more
efficiently than using the one shot operations.

This is used in the `BlockMap::sync` for `header_and_footer_blocks`
which spends a significant time in sumtree traversal due to repeatedly
transforming points between the different layers. This effectively turns
the complexity of those operations from quadratic in the number of
excerpts to linear, as we only go through the respective sumtrees once
instead of restarting from the start over and over again.

Release Notes:

- Improved performance for editors of large multibuffers with many
different files
Copy link
Collaborator

@maxbrunsfeld maxbrunsfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea ⚡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants