You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I run the snippet above and it now takes 2 seconds.
Twice as fast!
Do you think this is a good change? I think it's harmless: the routes of an app are fixed (not dynamic) so that REGEXES hash will reach a reasonable maximum size. Plus it can help with routes like ":id" where they might be used in several places.
What do you think?
The text was updated successfully, but these errors were encountered:
Hi @soveran! 馃槃
I noticed that to consume segments a regex is created each and every time the segment tries to be matched:
cuba/lib/cuba.rb
Line 214 in f661096
So I made this benchmark:
On my machine it takes about 4 seconds to complete.
Now I cache the regexes with this diff:
I run the snippet above and it now takes 2 seconds.
Twice as fast!
Do you think this is a good change? I think it's harmless: the routes of an app are fixed (not dynamic) so that REGEXES hash will reach a reasonable maximum size. Plus it can help with routes like ":id" where they might be used in several places.
What do you think?
The text was updated successfully, but these errors were encountered: