Introduce a few optimizations to SumTree and Buffer - #68
Merged
Conversation
Version vectors are going to be small most of the time, especially as soon as we introduce an optimization that will let us only track concurrent versions, thus preventing the version vector from growing indefinitely over time in the tree.
Anthony-Eid
added a commit
to Anthony-Eid/zed
that referenced
this pull request
Nov 26, 2024
* Sync breakpoints on toggle to other client * WIP Seperate local/remote in dap store * WIP initial breakpoints sync Co-Authored-By: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com> * Get zed to compile * Don't remove dap data when you unshare * Add breakpoints table migration * Update collab db when changing breakpoints * Store breakpoints inside collab db when you change them * Clean up * Fix incorrect clearing of breakpoints during collab sync * Get breakpoints to sync correctly on project join We now send SynchronizedBreakpoints within the JoinProjectResponse and use those breakpoints to initialize a remote DapStore. * Set breakpoints from proto method --------- Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com> Co-authored-by: Anthony Eid <hello@anthonyeid.me>
ShalashaskaOcelot
pushed a commit
to ShalashaskaOcelot/zed
that referenced
this pull request
Aug 7, 2026
Five bugs from the phase 63/64 test round, all filed in bugs.md with analysis. zed-industries#67 A vertical wheel dragged wide tables sideways while the notebook scrolled. gpui applies a wheel's other-axis delta to an element that scrolls in only one direction unless restrict_scroll_to_axis is set; the table now sets it, so it answers only to horizontal input and vertical wheels pass through. zed-industries#68 The horizontal scrollbar slid out from under the pointer when dragged: it was applied to the same element that scrolls, so it was laid out in content space and translated with the content. The scroll container is now a child of a plain wrapper that carries the scrollbars, matching ui's data_table. zed-industries#69 Column titles wrapped their last character even with room to spare. Headers render semibold but every column width was measured at regular weight, leaving each column a few pixels short of its own title. Titles are now measured semibold. zed-industries#70 Columns didn't line up row to row: in fill-width mode cells had grow factors but no flex basis, so each cell started from its own content width and every row distributed spare space differently. flex_basis(0) makes the split depend only on the per-column grow factors. zed-industries#72 Kernel status stuck on "Starting" until a cell ran. Kernels broadcast status: starting as they come up, and that message can land after the launch task has already installed the kernel as Running/Idle — overwriting it, with nothing to correct it until the next execution. A connected kernel is past starting, so that state is now ignored for a RunningKernel. Also filed zed-industries#71 (a cell being edited stops accepting input once scrolled out of view) undiagnosed, and backlogged a distinct "creating environment" state for the kernel strip, which currently shows the misleading "Starting" during a build. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JkvYRuX9r6PmLXpxNie2R7
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
Introduce a few optimizations to `SumTree` and `Buffer`
ShalashaskaOcelot
pushed a commit
to ShalashaskaOcelot/zed
that referenced
this pull request
Aug 13, 2026
Test results from 2026-08-11. Bugs zed-industries#7, zed-industries#66, zed-industries#67, zed-industries#68, zed-industries#70 and zed-industries#72 confirmed fixed and removed; zed-industries#64 failed and stays open with the finding recorded; zed-industries#73's repro is confirmed on Windows. Three fixes here. zed-industries#69 (column titles wrapping their last character) was NOT fixed by the previous attempt, and that attempt was aimed at the wrong layer. Measuring headers semibold was a real discrepancy and stays, but the cause is that the table renders at a different font SIZE from the one it measures with: ui's font_buffer sets only the font family, so the size stayed ambient while TableView::new measured against buffer_font_size. Every glyph then rendered a fraction wider than measured, and the error accumulates with string length — invisible on a 15-character title, just past the padding slack on a 16-character one, which is exactly the reported Column_number_9-fits, Column_number_10-wraps threshold. The rendered size is now pinned to the measured one. zed-industries#74: a notebook whose file was deleted while Zed was closed didn't restore at all, taking any unsaved changes with it. Nothing to do with deletion handling — open_buffer deliberately returns an empty buffer for a path with no entry, so the notebook parses, but try_open then demanded a worktree entry id and a deleted file has none. That id was already optional on NotebookItem (it is only a fallback for entry_id, which re-resolves from the path), so nothing needed it to be present. zed-industries#75: a restored untitled notebook showed no dirty marker until the next keystroke. Same trap phase 69 fixed for file-backed notebooks and missed here: rebuilding a notebook from stored JSON makes those cells their own baseline, so it reads as clean. Contents are only stored when there ARE unsaved changes, so a restored untitled notebook is unsaved by definition and now says so. Also filed zed-industries#76: restoring unsaved changes over a file edited elsewhere gives no notification. The conflict flag may well be set correctly and simply invisible until save time, which is the first thing to check — the two possible causes need different fixes, so nothing is attempted yet. Backlogged from zed-industries#72's confirmation: a restart should read Restarting → Idle, not Restarting → Starting → Idle. Verified: clippy clean, 57 repl tests pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JkvYRuX9r6PmLXpxNie2R7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As per the title, this pull request introduces a few of optimizations:
AnchortoTextSummarySumTreeto avoid unnecessary heap allocations that showed up in the profiler when mutating the tree a lot (e.g., multi-cursor insertion)time::Globalin terms of aSmallVecinstead of using aHashMap. The theory is that version vectors are going to be small most of the time, especially as soon as we introduce an optimization that will let us only track concurrent versions, thus preventing the version vector from growing indefinitely over time in the tree.