Sha256: d2b6ae5b939abd6093064f144b981b7739d7f474ec0698a1268052fc92406635

Contents?: true

Size: 1.21 KB

Versions: 38

Compression:

Stored size: 1.21 KB

Contents

#![feature(test)]

extern crate test;

use regex_syntax::Parser;
use test::Bencher;

#[bench]
fn parse_simple1(b: &mut Bencher) {
    b.iter(|| {
        let re = r"^bc(d|e)*$";
        Parser::new().parse(re).unwrap()
    });
}

#[bench]
fn parse_simple2(b: &mut Bencher) {
    b.iter(|| {
        let re = r"'[a-zA-Z_][a-zA-Z0-9_]*(')\b";
        Parser::new().parse(re).unwrap()
    });
}

#[bench]
fn parse_small1(b: &mut Bencher) {
    b.iter(|| {
        let re = r"\p{L}|\p{N}|\s|.|\d";
        Parser::new().parse(re).unwrap()
    });
}

#[bench]
fn parse_medium1(b: &mut Bencher) {
    b.iter(|| {
        let re = r"\pL\p{Greek}\p{Hiragana}\p{Alphabetic}\p{Hebrew}\p{Arabic}";
        Parser::new().parse(re).unwrap()
    });
}

#[bench]
fn parse_medium2(b: &mut Bencher) {
    b.iter(|| {
        let re = r"\s\S\w\W\d\D";
        Parser::new().parse(re).unwrap()
    });
}

#[bench]
fn parse_medium3(b: &mut Bencher) {
    b.iter(|| {
        let re =
            r"\p{age:3.2}\p{hira}\p{scx:hira}\p{alphabetic}\p{sc:Greek}\pL";
        Parser::new().parse(re).unwrap()
    });
}

#[bench]
fn parse_huge(b: &mut Bencher) {
    b.iter(|| {
        let re = r"\p{L}{100}";
        Parser::new().parse(re).unwrap()
    });
}

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/regex-syntax-0.8.5/benches/bench.rs
wasmtime-28.0.0 ./ext/cargo-vendor/regex-syntax-0.8.5/benches/bench.rs
wasmtime-27.0.0 ./ext/cargo-vendor/regex-syntax-0.8.5/benches/bench.rs
wasmtime-26.0.0 ./ext/cargo-vendor/regex-syntax-0.8.5/benches/bench.rs
wasmtime-25.0.2 ./ext/cargo-vendor/regex-syntax-0.8.4/benches/bench.rs
wasmtime-25.0.1 ./ext/cargo-vendor/regex-syntax-0.8.4/benches/bench.rs
wasmtime-25.0.0 ./ext/cargo-vendor/regex-syntax-0.8.4/benches/bench.rs
wasmtime-24.0.0 ./ext/cargo-vendor/regex-syntax-0.8.4/benches/bench.rs
wasmtime-23.0.2 ./ext/cargo-vendor/regex-syntax-0.8.2/benches/bench.rs
wasmtime-22.0.0 ./ext/cargo-vendor/regex-syntax-0.8.2/benches/bench.rs
wasmtime-21.0.1 ./ext/cargo-vendor/regex-syntax-0.8.2/benches/bench.rs
wasmtime-20.0.2 ./ext/cargo-vendor/regex-syntax-0.8.2/benches/bench.rs
wasmtime-20.0.0 ./ext/cargo-vendor/regex-syntax-0.8.2/benches/bench.rs
wasmtime-18.0.3 ./ext/cargo-vendor/regex-syntax-0.8.2/benches/bench.rs
wasmtime-17.0.1 ./ext/cargo-vendor/regex-syntax-0.8.2/benches/bench.rs
wasmtime-17.0.0 ./ext/cargo-vendor/regex-syntax-0.8.2/benches/bench.rs
wasmtime-16.0.0 ./ext/cargo-vendor/regex-syntax-0.8.2/benches/bench.rs
wasmtime-15.0.1 ./ext/cargo-vendor/regex-syntax-0.8.2/benches/bench.rs
wasmtime-15.0.0 ./ext/cargo-vendor/regex-syntax-0.8.2/benches/bench.rs
wasmtime-14.0.4 ./ext/cargo-vendor/regex-syntax-0.8.2/benches/bench.rs