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

Custom Diffing Implementation #433

Closed
kirawi opened this issue Jul 11, 2021 · 3 comments
Closed

Custom Diffing Implementation #433

kirawi opened this issue Jul 11, 2021 · 3 comments
Labels
A-core Area: Helix core improvements C-enhancement Category: Improvements E-hard Call for participation: Experience needed to fix: Hard / a lot

Comments

@kirawi
Copy link
Member

kirawi commented Jul 11, 2021

Currently, we depend upon similar to provide the diffing we need for :reload and in the future, file comparison (#405). However, this comes with a few drawbacks: (a) it can only operate on contiguous data, and (b) it is too expensive to calculate on moderately sized, extremely different files. A big part of that is our need to temporarily convert the Rope representation of the text into a String as Ropes are not a contiguous data structure. A histogram implementation and/or incorporating SIMD may also improve real-world performance, but it would not affect the time complexity of the algorithm which is currently O(n + (N+M)D).

Our main priority should be to investigate an alternative algorithm for :reload that can efficiently calculate a diff without human readability in mind, rsync, and how we can adapt these algorithms to be able to work on a Rope directly. I suspect that implementing the rsync algorithm would be the easiest one to tackle.

This is a difficult solution to a difficult problem, but it would be nice to have.

@kirawi kirawi added the C-enhancement Category: Improvements label Jul 11, 2021
@pickfire pickfire added E-hard Call for participation: Experience needed to fix: Hard / a lot A-core Area: Helix core improvements labels Jul 12, 2021
@kirawi
Copy link
Member Author

kirawi commented Sep 11, 2021

Pijul also recently rolled their own rsync implementation.

@kirawi
Copy link
Member Author

kirawi commented Jan 12, 2022

@kirawi
Copy link
Member Author

kirawi commented Nov 10, 2022

Will close in favor of #4457. That implementation is significantly faster for expected workloads.

@kirawi kirawi closed this as completed Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Helix core improvements C-enhancement Category: Improvements E-hard Call for participation: Experience needed to fix: Hard / a lot
Projects
None yet
Development

No branches or pull requests

2 participants