DanieleParravicini / regex_coprocessor

An accelerator to which you can offload RE matching and that does not use backtracking
6 stars 6 forks source link

What are the type of regular #10

Open DanieleParravicini opened 4 years ago

DanieleParravicini commented 4 years ago

Is there a specific combination of regex/strings that can clearly take advantage of such an architecture other than the one highlighted by cox in "Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby, ...)"?

DanieleParravicini commented 4 years ago
I think that this coprocessor performs well in case of a high number of alternatives. For this reasons has been implemented an optimization inside the compiler that tries to reshape the code so that in case of chain of splits it reshapes the operations so that they look like a tree, and hence the maximum latency (longest path inside the code) is minimum. regex : b* (a b c d)aa before after
optimization_before optimization_after