casouri / vundo

Visualize the undo tree.
469 stars 23 forks source link

Speedup draw-tree (+ document diff-keys) #85

Closed jdtsmith closed 11 months ago

jdtsmith commented 11 months ago

This simple fixes makes calls to (current-column) happen only when needed during draw-tree -- when there is no room for a new branch. Since current-column gets quite slow on long lines, calling it unnecessarily on each node in the tree leads to major (quadratically bad) slowdown.

jdtsmith commented 11 months ago

This speeds up draw-tree by >25x by eliminating most calls to current-column. As mentioned in the doc of that function, current-column gets quite slow for long lines, and we only need it rarely when there is no room for a branch.

casouri commented 11 months ago

Thanks! Merged. It would be even better if the commit message are written in the right format though.