diff options
Diffstat (limited to 'benches')
| -rw-r--r-- | benches/regex.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/benches/regex.rs b/benches/regex.rs index 577e44d..dd8f54a 100644 --- a/benches/regex.rs +++ b/benches/regex.rs @@ -1,8 +1,6 @@ use criterion::{Criterion, Throughput, criterion_group, criterion_main}; -use pish::parse::{ - Parse, - regex::{Pattern, bc::BytecodeCompiledRegex}, -}; +use pish::parse::Parse; +use pish::regex::{Pattern, RegexEngine}; /// https://mattmahoney.net/dc/enwik8.zip pub fn regex_throughput(c: &mut Criterion) { @@ -14,11 +12,11 @@ pub fn regex_throughput(c: &mut Criterion) { let mut re = |re: &str| { let pat = Pattern::parse_from_bytes(re.as_bytes()).unwrap(); - let compiled = BytecodeCompiledRegex::try_from(pat).unwrap(); + let compiled = pat.try_compile().unwrap(); group.bench_function(&format!("enwik6 {re}"), |b| { b.iter(|| { - let _ = compiled.re_match(&content); + compiled.matches(&content); }) }); }; |
