Delan Azabani

Fast request routing using regular expressions

Rarely is reimplementing your performance-critical code in C the best initial approach to optimisation. Most of the time, the fruit lies in the time complexities of the algorithms used. Request routing is one of these situations, where PHP developer Nikita Popov cleverly leverages the regex engine by bundling together chunks of route patterns, greatly reducing the number of iterations to dispatch to a handler.