3 ms·
For Photon, a micro framework for Mongrel2, we use regex. Even with 100's or 1000's of routes, you cannot even see the cost of preg_match when benchmarking beca
by Loic 15y ago
For Photon, a micro framework for Mongrel2, we use regex. Even with 100's or 1000's of routes, you cannot even see the cost of preg_match when benchmarking because the regex are organized in a tree following the URI structure like Django. It means that most of the time, a view is found within 2 to 3 preg_match calls.
This - regex is slow to match anchored strings on a 120 character long URI - is a myth.