After dealing with weird cases and bugs in the fastmatch implementation (see: D10098, D10113), I sought to determine what benefit we were reaping from it.
My conclusion is that it is currently offering almost no benefit. When I disable BSD_GREP_FASTMATCH, leaving bsdgrep(1) to only use regex(3), I find the following:
- regex(3)'s performance with literal expressions offers a speed improvement over fastmatch
- regex(3)'s performance, both with simple BREs and EREs, seems to be comparable
This implementation was imported in r226035, and at the time it also offered little improvement. I think our efforts could be better spent by addressing issues in regex(3) rather than hunting down bad behavior exhibited in these parts.
This is the first step, offering BSD_GREP_FASTMATCH as an option to disable it so that we can appropriately assess the situation with and without it enabled and make a more informed decision.