Basic and hard regexp optimise algorithms
Some of the implemented regexp optimizations are causing execution slowdown rather than speed up. Consider splitting the optimisation algorithm to basic and hard versions to do the necessary minimum plus optimisations that do speed up the execution and all optimisations, respectively.