Monday, July 13, 2009

Parallel Regular Expression Engine

Here's an interesting use for multi-core/processor programming: parallel regular expression engines. Now, granted, this only works on certain regular expressions, but in the cases where the regular expression has to choose between two or more different paths, it can slow down a regex, especially if it's complicated. Now, if you do each branch in parallel, then as paths don't match, they simply stop processing. At least this is how I see it working as I'm thinking in terms of Erlang-style concurrency. From the perspective of a programmer, I don't care about the paths that fail, I only care about the path that succeeds.

Now, I'm not 100% sure how much of an improvement this will give us in the normal cases, however for more complicated patterns may see some significant benefit, perhaps even making them more possible. And by more possible, I mean make them more likely to run in a reasonable amount of time.

Labels: , ,


Post a Comment

Links to this post:

Create a Link

<< Home