atom-archive / xray

An experimental next-generation Electron-based text editor
MIT License
8.48k stars 235 forks source link

Speed up Buffer::changes_since by skipping subtrees that haven't changed #136

Closed as-cii closed 5 years ago

as-cii commented 5 years ago

This pull request introduces a new Tree::filter method that allows skipping nodes of the B-Tree based on a predicate over each node's summary. This speeds up significantly Buffer::changes_since, which now scales with the number of changes that have occurred since the given version.

In the process of implementing this optimization, I also:

/cc: @nathansobo