mirror of
https://github.com/uutils/diffutils.git
synced 2026-06-10 15:48:59 -07:00
50057412bd
The utility should support all the arguments supported by GNU cmp and
perform slightly better.
On a "bad" scenario, ~36M files which are completely different, our
version runs in ~72% of the time of the original on my M1 Max:
> hyperfine --warmup 1 -i --output=pipe \
'cmp -l huge huge.3'
Benchmark 1: cmp -l huge huge.3
Time (mean ± σ): 3.237 s ± 0.014 s [User: 2.891 s, System: 0.341 s]
Range (min … max): 3.221 s … 3.271 s 10 runs
Warning: Ignoring non-zero exit code.
> hyperfine --warmup 1 -i --output=pipe \
'../target/release/diffutils cmp -l huge huge.3'
Benchmark 1: ../target/release/diffutils cmp -l huge huge.3
Time (mean ± σ): 2.392 s ± 0.009 s [User: 1.978 s, System: 0.406 s]
Range (min … max): 2.378 s … 2.406 s 10 runs
Warning: Ignoring non-zero exit code.
Our cmp runs in ~116% of the time when comparing libxul.so to the
chromium-browser binary with -l and -b. In a best case scenario of
comparing 2 files which are the same except for the last byte, our
tool is slightly faster.
51 lines
724 B
TOML
51 lines
724 B
TOML
|
|
[package]
|
|
name = "unified-diff-fuzz"
|
|
version = "0.0.0"
|
|
publish = false
|
|
edition = "2018"
|
|
|
|
[package.metadata]
|
|
cargo-fuzz = true
|
|
|
|
[dependencies]
|
|
libfuzzer-sys = "0.4.7"
|
|
diffutils = { path = "../" }
|
|
|
|
# Prevent this from interfering with workspaces
|
|
[workspace]
|
|
members = ["."]
|
|
|
|
[[bin]]
|
|
name = "fuzz_cmp"
|
|
path = "fuzz_targets/fuzz_cmp.rs"
|
|
test = false
|
|
doc = false
|
|
|
|
[[bin]]
|
|
name = "fuzz_cmp_args"
|
|
path = "fuzz_targets/fuzz_cmp_args.rs"
|
|
test = false
|
|
doc = false
|
|
|
|
[[bin]]
|
|
name = "fuzz_patch"
|
|
path = "fuzz_targets/fuzz_patch.rs"
|
|
test = false
|
|
doc = false
|
|
|
|
[[bin]]
|
|
name = "fuzz_normal"
|
|
path = "fuzz_targets/fuzz_normal.rs"
|
|
test = false
|
|
doc = false
|
|
|
|
|
|
[[bin]]
|
|
name = "fuzz_ed"
|
|
path = "fuzz_targets/fuzz_ed.rs"
|
|
test = false
|
|
doc = false
|
|
|
|
|