Skip to content

Commit

Permalink
Fix benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Aug 13, 2024
1 parent 474c58a commit 73951d2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions benches/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use libversion::*;
fn comparison_benchmark(c: &mut Criterion) {
c.bench_function("compare numeric", |b| {
b.iter(|| {
version_compare2(
version_compare(
"1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30",
"1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30",
)
Expand All @@ -14,30 +14,30 @@ fn comparison_benchmark(c: &mut Criterion) {

c.bench_function("compare alphabetic short", |b| {
b.iter(|| {
version_compare2(
version_compare(
"a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z",
"a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z",
)
})
});

c.bench_function("compare letter suffix", |b| b.iter(|| {
version_compare2(
version_compare(
"1a.2b.3c.4d.5e.6f.7g.8h.9i.10j.11k.12l.13m.14n.15o.16p.17q.18r.19s.20t.21u.22v.23w.23x.24y.25z",
"1a.2b.3c.4d.5e.6f.7g.8h.9i.10j.11k.12l.13m.14n.15o.16p.17q.18r.19s.20t.21u.22v.23w.23x.24y.25z"
)
}));

c.bench_function("compare alphabetic long", |b| b.iter(|| {
version_compare2(
version_compare(
"alpha.beta.pre.prerelease.postrelease.patch.errata.pl.p.alpha.beta.pre.prerelease.post.postrelease.patch.errata.pl.p",
"alpha.beta.pre.prerelease.postrelease.patch.errata.pl.p.alpha.beta.pre.prerelease.post.postrelease.patch.errata.pl.p",
)
}));

c.bench_function("compare mixed", |b| {
b.iter(|| {
version_compare2(
version_compare(
"1.2.alpha.3.beta.4.pre.5.post.6.patch.7.8a.9b.10c.11.a.12.b.13.c.d.e.f.0",
"1.2.alpha.3.beta.4.pre.5.post.6.patch.7.8a.9b.10c.11.a.12.b.13.c.d.e.f.0",
)
Expand All @@ -46,7 +46,7 @@ fn comparison_benchmark(c: &mut Criterion) {

c.bench_function("compare different length", |b| {
b.iter(|| {
version_compare2(
version_compare(
"1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",
"1"
)
Expand Down

0 comments on commit 73951d2

Please sign in to comment.