3 ms·
I built a router like this for Rails back in the 2.3 era. It was ridiculously fast for small route sets, but as the sets grew, the standard approach was actual
by jeremymcanally 13y ago
I built a router like this for Rails back in the 2.3 era. It was ridiculously fast for small route sets, but as the sets grew, the standard approach was actually faster. If your route set is small and routing is a bottleneck, though, this approach might work for you. :)
(I don't know how it would stand up against Journey, the Rails 4 router business. I imagine it's only gotten faster so there may be next to no gain)
- nikic 13y agoDid you read on to the end? I also had the problem that performance degraded with large route sets, but resolved it by matching in chunks of ten routes.