Not sure if this is the right place.
I saw some discussion on moving hanami-router to be trie-based. This is something I’ve been considering for Mustermann back when I first implemented it… 13 years ago. Wow, time flies.
I’ve implemented a proof of concept for Mustermann and wanted to see whether there is interest on Hanami’s side, or if the plan would instead be to move away from Mustermann (or leave things as they are).
This does further increase compilation time. I’m happy to look into this, though. It should at least be possible to eliminate the need to compile the individual patterns.
I’m also not sure where your pain points are and what realistic route sets are like. Compiling 10k routes with four levels of nesting (each nesting level being one static and one dynamic segment) takes 3.5s on my machine. However, matching against these only takes 4.9μs (vs 0.7s when matching in a linear fashion). The break-even point seems to be around 50 routes; anything below that performs worse with the trie-based approach. Could also implement both a linear and a trie-based route-set matcher and switch between them automatically based on either a hard-coded value or some match simulation (thinking RouteSet#optimize), though that might be a bit much.
Anyway, if this is interesting to you, then I’ll work on finishing the Mustermann-side, and would be happy to help with hanami-router.