i have many nested routes (nested inside nested inside nested…) and they are full resources so that generates many routes, slowing down my boot time and my application in general
Can you talk us through the design philosophy here? I’m struggling to understand why are so many routes needed and how you’re using them.
There are very few occurrences of _path in the code so I guess they’re fetched dynamically but I can’t figure out how.
As for performance, it’s going to be very hard to get good performance out of a router with this approach. You’re trying to use it in a way that’s not intended for it. You’ll get much better performance with a routing tree, like Roda: https://roda.jeremyevans.net/ The routing tree paradigm is much better suitable for very deep routing trees. It’s still just a rack endpoint so you could even mount it inside a Rails router.