Why couldn't Sinatra create some sort of underlying tree structure that could perform in O(log N) as opposed to O(N). That way you get the readability with the perf.
It couldn't create a tree in all instances because it allows full regexes in the routes. It could create a hybrid (split into trees for anything with a known static prefix), or go the full hog to a finite automata, though. But at least the latter is suddenly a big complexity increase.
vidarh|11 years ago