Open aantron opened 3 years ago
use a trie or a DFA instead of walking through all routes using CPS.
I experimented with this a lot when looking at routing implementation for routes
. At the moment tries
seemed like the most ideal approach when factoring in ease of implementation/maintenance (compared to dfa construction), and they allowed for easy composition of multiple routers. I also think tries will be fast enough for the vast majority of web applications and will probably have a more predictable memory usage as opposed to a dfa based solution.
Of course, everything should be measured first.
Some early notes from a few weeks ago: