Bráulio Bhavamitra <[email protected]> wrote: > Sakis, ressurecting this. > > I'm seeing this after the upgrade from rails 3.2 to rails 4.2. Maybe it is > because of adequate record and other "cached on first time used" stuff.
I'm not knowledgeable enough to comment on Rails , but "cache on first time used" includes the caches in the YARV RubyVM itself: 1) inline method cache 2) inline constant cache 3) global method cache The only way to warm up the inline caches is to actually run your code paths (perhaps in warmup code). After warmup, you need to avoid defining new classes/constants or doing includes/extends/etc because those things invalidate caches. ruby-core has been working to reduce the size of internal data structures in C to improve CPU cache utilization (which might make the explicit RubyVM-level caches less necessary for small apps). Ruby 2.3 should include some more speedups in method lookup; but having the smallest possible code base always helps. Regardless of language or VM implementation; big code and data structures invalidates caches on the CPU faster than smaller code and data structures. So reduce your application code size, kill unnecessary features, use a smaller framework (perhaps Sinatra, or even just Rack), load fewer libraries, etc. And yes, this mindset to making things smaller extends to mail: stop bloating them with top-posts and insanely long signatures. -- unsubscribe: [email protected] archive: http://bogomips.org/unicorn-public/
