4 ms·
Twitter was in a nice position to better Ruby in terms of performance, though they chickened out and escaped to Scala. Even Twitter went public recently and po
by cygwin98 13y ago
Twitter was in a nice position to better Ruby in terms of performance, though they chickened out and escaped to Scala.
Even Twitter went public recently and posed to challenge big guys such as Google, Facebook, they've lost my respect as a technology company.
- cgcardona 13y agoThat's a bit of an oversimplification. Here is a more in depth explanation in the form of a video of a talk called 'Twitter: From Ruby on Rails to the JVM'[1] from O'Reilly Con by Twitter engineer Raffi Krikorian who leads the Applications Services group. [1] http://www.youtube.com/watch?v=ohHdZXnsNi8 http://www.youtube.com/watch?v=ohHdZXnsNi8
- cygwin98 13y agoDidn't watch this video. But as far as I recalled back then, the guys at Twitter was complaining about the slowness of Rails and MRI, as Rails was not asynchronous and MRI was CPU-bound, so instead of fixing this root cause to apply the tricks from V8 to Javascript to improve Ruby,they chose the more "pragmatic" way to use Netty that is asynchronous and Scala that is way faster. I don't accuse them of not saving the world, but Ruby and Rails lost a great opportunity to dominate the web community. If Rails were as performant as Node.js, I doubt lots of companies would change gears.
- foobarian 13y agoI think organization type plays a role here too. ROR is an excellent fit for startups where speed of iteration is paramount; but once an organization settles on a business model and functionality matures a bit, the code stops changing so rapidly and the ability to do rapid development is not important any longer. At the same time performance becomes increasingly critical due to costs of scale. Hence a switch to something like scala makes perfect sense.
- laureny 13y ago> I don't accuse them of not saving the world, but Ruby and Rails lost a great opportunity to dominate the web community. They didn't lose this opportunity because of Twitter, they lost it because the fact that Ruby is dynamically typed puts a hard limit on how fast it can be. Twitter tried very hard to make it scale before making the decision to switch to Java, and they just couldn't do it. The task was just impossible, switching to Java was the only reasonable decision given their constraints.
- cygwin98 13y agoJavascript is also a dynamically typed script language, which Google managed to make at least one order of magnitude faster with V8. It's likely same tricks can be applied to Ruby.
- Daishiman 13y agoGoogle has a full-time team of some of the best compiler writers in the world wholly dedicated to tuning Javascript, and they have spent literally years to get it to perform how it does today, and it's still far from competing with the JVM, and will likely never be able to do basic things such as multithreading and proper type safety. Twitter was absolutely right in doing what they did.
- anonyfox 13y agohttps://www.paypal-engineering.com/2013/11/22/node-js-at-paypal/ https://www.paypal-engineering.com/2013/11/22/node-js-at-pay... Seems that node.js outperforms the JVM for WebDev nowadays.
- esailija 13y agoOtoh they don't use some top secret innovations but decades old techniques accessible to everyone. And language benchmarks don't tell the whole story. In Java, idiomatic and typical code will be optimized very well whereas in Javascript such code runs easily at least an order of magnitude slower than its potential. Try to run some idiomatic JS through https://github.com/petkaantonov/nodeperf/ https://github.com/petkaantonov/nodeperf/ and see it explode :) So even if Javascript can be shown in some benchmark to close on the JVM, the benchmarks are ignoring the fact that you cannot write Javascript carelessly to get anywhere near those speeds unlike with Java.
- laureny 13y ago> Twitter was in a nice position to better Ruby in terms of performance, though they chickened out and escaped to Scala. Actually, they escaped to the JVM, and if their job reqs are any indication, they hire massively for Java engineer positions and hardly at all for Scala ones. I wouldn't call that chickening out, more common sense. Rails is great for prototypes and toy apps, but once you start needing scale, it's simply not up to the task.
- ropiku 13y agoI work at Twitter. Actually we use very little Java while almost every service is written in Scala.
- why-el 13y ago> Rails is great for toy apps This gets said here a lot. What about GitHub and Shopify, and ...? Are those toy apps?
- porker 13y agoI'm curious too how much of each of these is still built on Rails, and how much has been tweaked, tuned and rewritten to be 'inspired' by Rails, but no longer Rails.
- why-el 13y agoGood question. I would say it varies, but after all they are mostly likely not changing things dramatically, at least thats what you get from watching talks from both companies[1]. [1] http://www.slideshare.net/jduff/how-shopify-scales-rails-20443485 http://www.slideshare.net/jduff/how-shopify-scales-rails-204...
- berntb 13y agoI've browsed this discussion and I must miss something? You seem to imply Ruby's/Rails' speed matter? Usually, the DB is the limiting factor in most web applications, few should need to execute more than a few milliseconds of (even) Ruby per page load. That is why people use scripting languages, after all. Shouldn't this slowdown be a problem in the ORM for this version? I'd look at access patterns for normal requests for the new Rails version and the old. How has the SQL changed? Sure, Twitter is different since that probably is processor bound. (Since RoR is a popular framework with lots of eyes, there shouldn't be something simple with e.g. configuring the web server, locking etc.)
- gregoryw 13y agoTwitter is probably the best technology company that has ever helped this community. They built bootstrap to help start of all your companies, and open sourced Mesos for when you get big. If rvm was saveable they would have not rewrote that mono app into services. A tuned JVM is a great compromise of performance and development flexibility.
- jpk 13y agoThey switched to the right tool for the job, with great success. They've contributed heaps of open source code to the community. (https://github.com/twitter https://github.com/twitter) But they didn't magically make Rails fast, so screw them?