Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

This directory contains a Rust runner program for benchmarking RE2. RE2 was written by Russ Cox and came out of his series of articles on Implementing Regular Expressions. The big idea behind RE2 was to provide a subset of Perl regular expression features while using finite automata to guarantee that searches execute in time linear to the length of the haystack.

RE2 has several regex engine descendents, notably, Go's standard library regexp package and Rust's regex crate. All three libraries have a similar implementation strategy. That is, each contains a number of internal regex engines, and for each search, one (or more) of those engines is selected based on various criteria to service a request. In most cases, the criteria considered is performance.

This Rust runner program makes the following decisions:

  • Only one pattern is supported. (We do not benchmark RE2's "regex set" functionality.)
  • When Unicode mode is disabled, then we compile regexes using RE2's EncodingLatin1 option. Note that like Go's regexp package, the \w, \d and \s character classes always use their ASCII definition.