pascalkuthe / imara-diff Goto Github PK
View Code? Open in Web Editor NEWhisto_diff
License: Apache License 2.0
histo_diff
License: Apache License 2.0
Just now I have integrated imara-diff
into gitoxide
, replacing similar
for a stunning 2x speedup when running ein t h -l
. Thanks to your work gitoxide
can excel even with diff performance, a previously undercooked feature that I cobbled together quickly. With imara-diff
I have the feeling that I can built on top of a crate that acknowledges git
and sees it as baseline, along with the desire to improve on it. It's probably what I would have wanted to have in git-diff
verbatim if there would have been enough time (butโฆ I am also glad I didn't have to implement it myself ๐
).
Thank you sooo much ๐
Running the test with Miri using MIRIFLAGS="-Zmiri-disable-isolation" cargo +nightly miri test
for this repo results in a SIGKILL
.
running 5 tests
test tests::complex_diffs ... error: test failed, to rerun pass `--lib`
Caused by:
process didn't exit successfully: `/usr/local/rustup/toolchains/nightly-aarch64-unknown-linux-gnu/bin/cargo-miri runner /data/target/miri/aarch64-unknown-linux-gnu/debug/deps/imara_diff-b916e6c16bd4f65d` (signal: 9, SIGKILL: kill)
This might have something to do with the issue reported in rust-lang/rust#112171.
Performing a word diff over a full file can be fairly slow on large files.
A better approach is to perform a line diff first and and then perform the word diff on the found changes.
While this is already possible with imara-diff
is requires quite a bit of legwork and can be tricky to get right.
It would be nice if this could be included in the library directly.
This has multiple steps for an implementation:
Vec
?TokenSource
for wordsSink
that automatically computes a word diffThe diff algorithm in git only operates on lines. It is worth looking into what exactly they use to produce a colored word diff from the line diff.
Perhaps a different algorithm is a better fit?
Hey, thanks for making this crate. :)
Would it be possible to call diff
without having to intern the input first? In my use case (character-wise diffing) interning doesn't seem necessary, as chars
should be as cheap to compare as Tokens (that are just u32
's under the hood) - and interning has it's non-trivial cost.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.