Skip to content

Commit

Permalink
bench: reduce huge regex a bit
Browse files Browse the repository at this point in the history
It looks like it blows the default regex size limit at the moment.
  • Loading branch information
BurntSushi committed Mar 12, 2021
1 parent f858ff3 commit 691ec58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bench/src/rust_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,20 @@ fn compile_small_full(b: &mut Bencher) {
#[bench]
fn compile_huge(b: &mut Bencher) {
b.iter(|| {
let re = Parser::new().parse(r"\p{L}{100}").unwrap();
let re = Parser::new().parse(r"\p{L}{50}").unwrap();
Compiler::new().size_limit(1 << 30).compile(&[re]).unwrap()
});
}

#[bench]
fn compile_huge_bytes(b: &mut Bencher) {
b.iter(|| {
let re = Parser::new().parse(r"\p{L}{100}").unwrap();
let re = Parser::new().parse(r"\p{L}{50}").unwrap();
Compiler::new().size_limit(1 << 30).bytes(true).compile(&[re]).unwrap()
});
}

#[bench]
fn compile_huge_full(b: &mut Bencher) {
b.iter(|| regex!(r"\p{L}{100}"));
b.iter(|| regex!(r"\p{L}{50}"));
}

0 comments on commit 691ec58

Please sign in to comment.