From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- third_party/rust/semver/benches/parse.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 third_party/rust/semver/benches/parse.rs (limited to 'third_party/rust/semver/benches/parse.rs') diff --git a/third_party/rust/semver/benches/parse.rs b/third_party/rust/semver/benches/parse.rs new file mode 100644 index 0000000000..d6aded7802 --- /dev/null +++ b/third_party/rust/semver/benches/parse.rs @@ -0,0 +1,24 @@ +#![feature(test)] + +extern crate test; + +use semver::{Prerelease, Version, VersionReq}; +use test::{black_box, Bencher}; + +#[bench] +fn parse_prerelease(b: &mut Bencher) { + let text = "x.7.z.92"; + b.iter(|| black_box(text).parse::().unwrap()); +} + +#[bench] +fn parse_version(b: &mut Bencher) { + let text = "1.0.2021-beta+exp.sha.5114f85"; + b.iter(|| black_box(text).parse::().unwrap()); +} + +#[bench] +fn parse_version_req(b: &mut Bencher) { + let text = ">=1.2.3, <2.0.0"; + b.iter(|| black_box(text).parse::().unwrap()); +} -- cgit v1.2.3