zed icon indicating copy to clipboard operation
zed copied to clipboard

buffer: Track dirty state based on undo stack and not on content

Open osiewicz opened this issue 4 months ago • 0 comments

Buffer hashing is a significant contributor to file loading time, even after changes made in https://github.com/zed-industries/zed/pull/7731 This PR foregoes hashing the buffer contents altogether. Instead, we now mark the buffer as dirty after it's changed. This means that a series of edits that leads to an identical file contents as those on disk will leave the buffer in a dirty state. An important property of this implementation is that undos can turn the buffer back into non-dirty state. Release Notes:

  • Improved performance and memory usage when working with large files.

osiewicz avatar Mar 05 '24 17:03 osiewicz