Skip to content

feat: Divan Benchmark#185

Merged
sylvestre merged 4 commits intouutils:mainfrom
GunterSchmidt:cmp-feat--criterion-benchmarks
Mar 7, 2026
Merged

feat: Divan Benchmark#185
sylvestre merged 4 commits intouutils:mainfrom
GunterSchmidt:cmp-feat--criterion-benchmarks

Conversation

@GunterSchmidt
Copy link
Contributor

@GunterSchmidt GunterSchmidt commented Mar 2, 2026

During development it is often helpful to be able to quickly benchmark the recent changes.

Criterion offers the ability to bench single functions.

This PR introduces criterion and has benches for the parsers (negligible) and cmp compare.

Has also a support function to generate large files to compare for bench-marking.

Update: Changed to Codspeed with Divan.

@sylvestre
Copy link
Collaborator

we, uutils, use codspeed

ex: uutils/coreutils#10996

could you please copy what is done with coreutils ?
thanks

@oech3
Copy link
Contributor

oech3 commented Mar 2, 2026

CodSpeed does not count some syscalls. How about your suggestion?

@GunterSchmidt
Copy link
Contributor Author

@sylvestre : I am not sure what you mean by "copy". Could you please elaborate.

I just migrated to codspeed criterion drop-in replacement. But would you like me to drop Criterion and use the divan benchmark instead? At this early stage this would not be too hard.

@sylvestre
Copy link
Collaborator

yes, please use divan
and i will connect codspeed to this repo

@GunterSchmidt
Copy link
Contributor Author

I removed Criterion and migrated the tests to Divan.

@GunterSchmidt GunterSchmidt changed the title feat: Criterion Benchmark feat: Divan Benchmark Mar 4, 2026
@GunterSchmidt
Copy link
Contributor Author

I found the performance.md for coreutils and will rework this now to match that logic.

@sylvestre sylvestre merged commit 54c8b7a into uutils:main Mar 7, 2026
26 checks passed
@codecov
Copy link

codecov bot commented Mar 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (6f082c6) to head (725b89f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #185   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

bencher
// .with_inputs(|| prepare::cmp_params_identical_testfiles(lines))
.with_inputs(|| params.clone())
.bench_refs(|params| black_box(cmp::cmp(&params).unwrap()));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, i approved it too quickly. you should not call it as blackbox

the stack isn't currently interesting:

Image

it should call the rust function directly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, will remove blackbox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants