Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed

Conversation

jdtsmith
Copy link
Contributor

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 jdtsmith changed the title Document diff keys in README Document diff keys and speedup draw-tree Dec 16, 2023
@jdtsmith
Copy link
Contributor Author

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.

@jdtsmith jdtsmith changed the title Document diff keys and speedup draw-tree Speedup draw-tree (+ document diff-keys) Dec 16, 2023
@casouri
Copy link
Owner

casouri commented Dec 17, 2023

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

@casouri casouri closed this Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants