4 ms·
It amazes me when I go to conferences and I see how many people are still using 1.8 rather than 1.9 or JRuby, which may not be comparable to LuaJIT but offer mu
by compay 16y ago
It amazes me when I go to conferences and I see how many people are still using 1.8 rather than 1.9 or JRuby, which may not be comparable to LuaJIT but offer much more respectable performance.
I also really sympathize with the notion of sacrificing some degree of expressiveness for performance. If this feature is to be added, it needs to be done in such a way that it does not set back the hard-earned performance improvements of the last few years.
Then again, expressiveness is Ruby's niche, and DHH's famous quote about "sacrificing CPU cycles in favor of developer cycles" is quite valid, IMHO. If you need raw performance you should look to another language because I don't think that will ever be too high a priority for Ruby.
Github uses Node and (IIRC) Erlang for some stuff, and Twitter uses Scala - if you're lucky enough to have the kinds of problems those guys have, then the best bet is usually to use Ruby where it gets you a developer speedup and another language for the parts of your app where performance is absolutely critical.
- steveklabnik 16y agoWhile I try to start all of my new projects in 1.9, there are still good reasons to stick with 1.8. There are still a bunch of incompatibilities with gems, certain distributions coughUbuntucough still distribute 1.8 under the 'ruby' package, and large amounts of legacy code that's not 1.9 ready, for example. That said, even though 1.8 is slow as a dog, often, it's _fast enough_. Your last paragraph hits it on the head.
- krainboltgreene 16y agoAnytime someone asks for help on installing Ruby on Ubuntu I tell them to avoid the package manager. Use RVM, it's a small bit of overhead that greatly increases productivity and reduces headaches.
- steveklabnik 16y agoAbsolutely, and with .rvmrc files, you don't even need to think about it.
- krainboltgreene 16y agoGod yeah, I just got introduced to .rvmrc files. Talk about insane awesome. The next programming language I use full time will have to have all the RVM features and utilities built into their RubyGem like utility, or I'm not even going to bother.
- ekidd 16y agoIf you need raw performance you should look to another language because I don't think that will ever be too high a priority for Ruby. I reject this philosophy: Lua is also a highly expressive programming language, and LuaJIT runs 75 to 100 times faster than Ruby 1.8. There's no reason why the Ruby community should settle for lousy performance. I'm trying to track down a bug in the Rubinius JIT as I speak. Rubinius may be faster than 1.9, but I can still see dozens of really obvious optimization opportunities. If nobody screws up method caching, Ruby will eventually be 10 times faster than it is today.
- rubyrescue 16y agoIronically compay is a huge Lua proponent, having brought over some ruby-born projects like HAML into Lua... :)
- compay 16y agoWell, I'm very glad there are people who are willing to do the hard work to improve Ruby's performance. If ekidd can help bring it up to a significant fraction of LuaJIT's, I'll line up in the pouring rain to be the first one to buy him a beer. :)
- dasil003 16y agoIn this case it doesn't even seem fair to say expressiveness would be sacrificed, because expressiveness is just as much about human comprehension as it is about powerful code modification. In the current implementation there are too many ways for refinements to leak out of their defined context, granted it could be argued that this makes refinements more powerful, but it also undermines their very purpose (ie. isolating code). I'm not a Ruby internals expert, but I've done my fair share of meta programming and debugging of monkey-patch conflicts. A more static version of refinements will give 99% of the benefit while avoiding most of the landmines Charles is describing. The other 1% can probably be served by adopting some other technique rather than looking to refinements. Ruby is already such a dynamic and powerful language that it seems silly to say that refinements need to have this uber-flexibility. All they need to be able to do is isolate monkey patches within a library and they've already provided a huge practical benefit. Being able to inject refinements into someone else's code? That's just not very important, and if it is for some particular case there are other techniques Ruby affords you, all of which should be used cautiously. Barring some flaw in Charles' analysis, I'd say it's a no brainer that refinements need to go back to the drawing board.
- vegai 16y agoPeople use ruby-1.8 because nothing works against ruby-1.9. And by 'nothing' I mean not rails 2.3.
- compay 16y agoI have not had problems running Rails 2.3 on Ruby 1.9.2.
- vegai 16y agoDoes your app have i18n?
- compay 16y agoNo, none of the 2.3 apps I've run on 1.9.2 have i18n.
- vegai 16y agoAlso, we heavily share code and data between applications with symlinks. Symlink handling (especially the interpretation of ..) is different in all ruby-1.8, ruby-1.9 and jruby. Makes the whole ecosystem smell like different ghettos. Perhaps they'll change that in 2.0 as well.