4 ms·
How much of the time in a given request is even spent in Ruby code? The majority of web apps that were slow and I got a chance to analyze were spending much of
by ajmurmann 3y ago
How much of the time in a given request is even spent in Ruby code? The majority of web apps that were slow and I got a chance to analyze were spending much of the time in DB queries and slowness was usually due to unoptimized DB queries. Even endpoints that were fast, still spent a large percentage of their time not in Ruby but in DB and service requests
- pdimitar 3y agoThat is true, yes, but still comparing e.g. Rust vs. Ruby I'd think Rust spends anywhere from 10ns to 100ns (outside of waiting on DB) and Ruby no less than 10 ms. Still pretty significant and can add up during times of big load. Also I remember Rails' ActiveRecord having some pretty egregious performance footprint (we're talking 10ms to 100ms on top of DB waiting) but I hear that was fixed a while ago.
- ajmurmann 3y agoMy point was that if we look at Rails performance going up 10%, what does that mean for time spent in Ruby. I'd believe anything from a 15% to a 80% reduction of time spent in Ruby code
- pdimitar 3y agoI haven't seen 80% anywhere in the linked article[0] so let's use facts and not beliefs. It is possible Ruby itself got accelerated a lot, okay, I am just not sure that's relevant since almost all Ruby usage is Rails. [0] https://railsatscale.com/2023-09-18-ruby-3-3-s-yjit-runs-shopify-s-production-code-15-faster/ https://railsatscale.com/2023-09-18-ruby-3-3-s-yjit-runs-sho...
- ajmurmann 3y agoI wasn't trying to say that Ruby indeed is 80% faster, but that it's pretty much impossible to drive actual Ruby speed up from Rails numbers, since we don't know nearly enough about the Rails app