Since several people are chiming in with suggestions for what might make rails slow I will throw in my two pence.
Profile things, and make sure you understand the results of the profile (because profilers can lie to you in a whole variety of ways).
When I last checked on TruffleRuby some time ago the slowest thing on a small rails app was all the layers of framework and all the points at which it might log things, while the actual database access and the use of that data was pretty quick.
This might not continue to be true for larger applications, but it probably means there is a high minimum amount of work that must be done per request, and it’s so deep on the stack that it’s unlikely to be optimised away.
The situation may have improved, we’ve done a lot of work on TruffleRuby since then and completely changed the inlining strategy at least once, and the method lookup and dispatch. But the profiler has also changed significantly so the way it lies will also be different now.
Profiler will not show the load time till all the framework and the includes are loaded though.
Which is were alot of time is spend. Just having that whole dependency tree parsed in and hashed up.
Wish there were more way to reduce libraries to subsets and not loose that on update.
Sure it will. It didn't dominate the profiles I was looking at because I was measuring peak performance so had waited until after everything had been loaded and had time to be JIT compiled etc. but it's quite common to see an extremely significant chunk of time used by initial requires and configuration.
Profile things, and make sure you understand the results of the profile (because profilers can lie to you in a whole variety of ways).
When I last checked on TruffleRuby some time ago the slowest thing on a small rails app was all the layers of framework and all the points at which it might log things, while the actual database access and the use of that data was pretty quick.
This might not continue to be true for larger applications, but it probably means there is a high minimum amount of work that must be done per request, and it’s so deep on the stack that it’s unlikely to be optimised away.
The situation may have improved, we’ve done a lot of work on TruffleRuby since then and completely changed the inlining strategy at least once, and the method lookup and dispatch. But the profiler has also changed significantly so the way it lies will also be different now.