-
Notifications
You must be signed in to change notification settings - Fork 78
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
diff: add new diff package based on Go 1.19 patience diff implementation #157
Comments
Thumbs up from me! Will you also help keep it in sync with upstream? :) cc @josharian |
If there is interest, some details include:
|
👍 |
With that input from @mvdan, I think we have consensus enough to move forward. Thanks for suggesting this! |
I'd also like for pkg/diff to improve, because in a way I'd love for a small diff package to exist in Go without having to pull in all of go-internal. But I guess that, for now, adding go-internal as a module dependency isn't a big deal, given that it itself will have zero dependencies. |
From Go tip as of March 21st 2023, at commit 5f1a0320b92a60ee1283522135e00bff540ea115. The only change is to replace the internal/txtar dependency with our own txtar package. It seems like upstream has its own tiny copy of x/tools/txtar, presumably so that even low level packages can use txtar in tests. Fixes rogpeppe#157.
From Go tip as of March 21st 2023, at commit 5f1a0320b92a60ee1283522135e00bff540ea115. The only change is to replace the internal/txtar dependency with our own txtar package. It seems like upstream has its own tiny copy of x/tools/txtar, presumably so that even low level packages can use txtar in tests. Fixes #157.
Hi there👋, I would be interested in sending a PR to add a new diff package to go-internal based on the patience diff implementation Russ added in CL 384255 during 1.19 dev cycle.
Compared to the the current pkg/diff used by go-internal, it is faster and much more memory efficient, running in O(n log n) time and I think it is O(n + m) space.
I currently have a copy here:
https://github.com/thepudds/patience-diff
I think go-internals would be a better home for it, including I think it is generally useful for the community, it would bring go-internal down to zero external dependencies (which is part of my selfish reason for being interested in a PR), as well as help deal w/ current testscript diff performance issues such as:
https://github.com/rogpeppe/go-internal/blob/master/testscript/cmd.go#L144-L148
A sample performance comparison (which I originally posted in pkg/diff#26 (comment)):
The text was updated successfully, but these errors were encountered: