8 ms·
Autotuner: How to speed up your Rails app
- Alifatisk 2y agoGithub: https://github.com/Shopify/autotuner https://github.com/Shopify/autotuner It’s incredible how much Shopify is investing in Rails (& Ruby for that matter). And I assumr the investment is paying off because otherwise they wouldn’t continue like this.
- bigEnotation 2y agoI wonder what the break even point would be to just have switched to use JVM.
- ajmurmann 2y agoThe problem is the "just switching" typically means a full rewrite and has a ton of logistic challenges. Are you gonna higher an entire second team? What happens to feature work on the current system? If you keep going full-throttle on features, you'll never catch up. If you stop developing features for a prolonged time, you are putting your entire business at risk. Writing new services in Java might help, but still doesn't solve the main issue if your Rails app is a monolith. Breaking up the monolith might be a bad decision and is also super expensive and might even eat lots of the potential performance gains.
- regularfry 2y agoRails on JRuby was a tenable proposition last I looked. Been a while though.
- norman784 2y agoJRuby is far behind CRuby, so there are a lot of gems that you can't use, also there are not too many companies investing in JRuby itself, IMHO CRuby it's a safer bet.
- mdaniel 2y agoI believe TruffleRuby <https://github.com/oracle/truffleruby https://github.com/oracle/truffleruby> is the state of the art for Ruby on the JVM, and <https://news.ycombinator.com/item?id=33503622 https://news.ycombinator.com/item?id=33503622> says that Mastodon works on it, so that's one data point. I haven't worked up the emotional energy to try to get GitLab to run on it
- ericb 2y agoI was in a large org that did this for a while. It was extremely painful to be this far off the beaten path. When you stay in the well trod C Ruby path, you benefit from the hordes of others who cleared the landlines before you. With JRuby, not so.
- rco8786 2y agoStill around but it's significantly slower than stock Ruby.
- ransom1538 2y agoTo save VM instance costs (not disks)? Probably never.
- bastawhiz 2y agoStripe tried switching lots of code to the JVM and it was a huge disaster. Unless you already have lots of small services with clean interfaces and their own data stores that can be incrementally switched, you spend far more time bending over backwards to keep two systems running (one with some limited parity with the other) in tandem. The cost of running the system is almost never bottlenecked by the performance of the language itself, but rather the responsibilities of the system and cleanliness of the code. Plus, in the migration, you start incurring the cost of your Ruby code calling your JVM code (and vise versa; your systems are almost certainly not a DAG), which almost certainly has higher overhead than whatever speedup you'd get from running code in the JVM in the first place. And then you're sharing protobufs/thrift files/whatever between different languages and libraries of varying degrees of quality (good luck with those Ruby protobufs!). Before you know it, writing a little tool to optimize your Ruby garbage collector sounds like a really great idea.
- parentheses 2y agoStripe and Shopify are such polar opposites. Stripes profit per web request is super high. Shopify has to monetize infrastructure efficiency.
- gregors 2y agoI think it's also a by-product of the CEO starting the company in Rails, and now having top engineers being part of Ruby core team or Rails core team. To a certain degree they'r steering the Ruby/Rails ship technically. Why would they bother switching if Shopify isn't having fundamental problems and they're the tog dog in their stack?
- whalesalad 2y agosunk cost
- andrewmutz 2y agoI love to see how active and vibrant the Rails community is. I used to be concerned about the viability of building new companies in Rails, since the ruby share of languages is so low these days. Based on the still-healthy community and the ridiculous productivity level that a developer can have with Rails 7+ (turbo, morph, stimulus) I still think its a fantastic stack to build a company with.
- Syntaf 2y agoFrom personal experience, I also appreciate that it's one of the easier stacks to keep updated with the latest and greatest. I've upgraded projects from sprocket-backed asset pipelines to bun in a couple days time, and the new tooling you get with modern rails really make upgrading worth it. Last year I started a new project[1] for a member management platform and really fell in love with the new jsbundling pipeline paired with stimulus, it feels like I've rekindled my passion that led me into programming initially; the ability to hack & prototype with rails is pretty unmatched (though it's worth mentioning Django holds a special place in my heart as well) [1] https://embolt.app https://embolt.app
- RowanH 2y agoI would imagine with cutbacks on spending/investing I think people getting leaner and meaner will re-visit the sheer productivity you can get out of it. Sure shaving the last 10/10ths of having a SPA with simple API based back end gets the ultimate user experience and speed but that cost curve goes up significantly for that last 10th (if you were to compared to an 'old school' Rails app) I can't even fathom what it would have taken to build our startups' product in say React + Node (as an example..) vs OG Rails SSR. I look at a "sort of" competitor in our industry, and their rate of feature development is ridiculously slow by comparison.
- ecshafer 2y agoIf you haven't given Turbo and Stimulus a shot, I would recommend it. Way faster to write than React, and super fast and performant. I would say its definitely the way to go with Rails pages that aren't extremely simple.
- daviding 2y agoI tried this and couldn't get it to work on a Rail 7.1 Ruby 3.2, no output. The readme.md could do with some examples of what sort of recommendations come out. Edit: it outputs metric, just no recommendations so moving on.
- kristianp 2y agoTo provide some detail if you haven't clicked, it tunes the Ruby garbage collector based on runtime behaviour.
- Didah 2y agoIs there something similar for flask apps that anyone knows of?