Repository navigation
Conversation
since Codspeed cannot trace syscalls into child processes spawned with `std::process::Command`, gate those benchmarks under #[cfg(not(codspeed))] so it still runs locally
for more information, see https://pre-commit.ci
ad54efc to
56995d6
Compare
Merging this PR will not alter performanceWarning uutils has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed. 1 warning
Performance Changes
Comparing Footnotes
|
|
Codspeed is failing due to high memory usage for files above This is due to the quadratic memory usage of the naive LCS algorithm. |
The memory usage while running locally is off the charts. Maybe we should only bench |
| // use diffutilslib::params; | ||
| #[cfg(not(codspeed))] | ||
| use crate::binary; | ||
| use crate::{prepare::*, FILE_SIZE_KILO_BYTES, MB}; |
There was a problem hiding this comment.
MB is not used in this module, it will warn
There was a problem hiding this comment.
Ahh, forgot to remove this 😅
|
|
||
| // bench the actual diff comparison in-process on differing files | ||
| #[divan::bench(args = FILE_SIZE_KILO_BYTES)] | ||
| fn diff_compare_files_different(bencher: Bencher, bytes: u64) { |
There was a problem hiding this comment.
almost the same code as diff_compare_files_equal, could be dedup with a small helper, no?
|
Also, what should we do about the large file tests? Keep it failing? |
| } | ||
|
|
||
| // bench the actual diff comparison in-process on identical files | ||
| #[divan::bench(args = FILE_SIZE_KILO_BYTES)] |
There was a problem hiding this comment.
please limit these to [100, 1 * MB] for now, the 10/25 MB runs are what kill the codspeed job
we can go back to FILE_SIZE_KILO_BYTES once #401 is fixed
There was a problem hiding this comment.
Sure thing! Pushing a commit now
|
I've pushed a commit to limit to 1MB maximum for |

Summary
This update refactors the performance benchmark suite to execute diff operations in-process rather than via external command-line process calls. Additionally, it introduces
codspeedconditional compilation flags to optimize and filter out external binary execution benchmarks during CI runner execution.Resolves: #430
Key Changes
diffutils_diffbenchmarks to usenormal_diff::diffdirectly in-process with pre-loaded file contents.#[cfg(not(codspeed))]attributes to conditionally disable external binary execution tests when running under CodSpeed. (It will still run locally)stdoutandstderroutputs in binary process execution wrappers to eliminate I/O overhead skewing.unexpected_cfgslinter check for thecodspeedconfiguration flag inCargo.toml.Verification & Testing
cargo bench --bench bench-diffutilscodspeedcfg flag enabled/disabled.****