Created by: Shell-Wataru
I changed ApplicationController's routes's class to Set to speed up valid_action?
.
Let N
be number of routes.
valid_action?
checks all routes in current version. So the time complexity is O(N)
.
When we store routes
as Set, the time complexity is O(log N)
.
My application has hundreds of routes. valid_action?
took a long time.