Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/semver/benches/parse.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / semver / benches / parse.rs` 21 lines ยท 716 bytes Raw Blame History 1 use criterion::{criterion_group, criterion_main, Criterion}; 2 use semver::{Prerelease, Version, VersionReq}; 3 use std::hint; 4 5 fn bench(c: &mut Criterion) { 6 c.bench_function("parse Prerelease", |b| { 7 let text = "x.7.z.92"; 8 b.iter(|| hint::black_box(text).parse::().unwrap()); 9 }); 10 c.bench_function("parse Version", |b| { 11 let text = "1.0.2021-beta+exp.sha.`5114f85`"; 12 b.iter(|| hint::black_box(text).parse::().unwrap()); 13 }); 14 c.bench_function("parse VersionReq", |b| { 15 let text = ">=1.2.3, <2.0.0"; 16 b.iter(|| hint::black_box(text).parse::().unwrap()); 17 }); 18 } 19 20 criterion_group!(benches, bench); 21 criterion_main!(benches);