<p>I'm pretty keen to develop my first Ruby app, as my company has finally blessed its use internally.</p>

<p>In everything I've read about Ruby up to v1.8, there is never anything positive said about performance, but I've found nothing about version 1.9. The last figures I saw about 1.8 had it drastically slower than just about everything out there, so I'm hoping this was addressed in 1.9.</p>

<p>Has performance drastically improved? Are there some concrete things that can be done with Ruby apps (or things to avoid) to keep performance at the best possible level?</p>

[{'answer_id': 25955, 'author': 'Matt Sheppard', 'author_id': 797, 'author_profile': 'https://Stackoverflow.com/users/797', 'pm_score': 1, 'selected': False, 'text': '<p>I\'ve actually heard really good things performance with about the JVM implementation, JRuby. Completly anecdotal, but perhaps worth looking into.</p>\n\n<p>See also <a href="http://en.wikipedia.org/wiki/JRuby#Performance" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/JRuby#Performance</a></p>\n'}, {'answer_id': 25961, 'author': 'Matt Sheppard', 'author_id': 797, 'author_profile': 'https://Stackoverflow.com/users/797', 'pm_score': 3, 'selected': False, 'text': '<p>There are some benchmarks of 1.8 vs 1.9 at <a href="http://www.rubychan.de/share/yarv_speedups.html" rel="nofollow noreferrer">http://www.rubychan.de/share/yarv_speedups.html</a>. Overall, it looks like 1.9 is a lot faster in most cases.</p>\n'}, {'answer_id': 26207, 'author': 'TonyLa', 'author_id': 1295, 'author_profile': 'https://Stackoverflow.com/users/1295', 'pm_score': 2, 'selected': False, 'text': '<p>Matz ruby 1.8.6 is much slower when it comes to performance and 1.9 and JRuby do alot to speed it up.  But the performance isn\'t such that it will prevent you from doing anything you want in a web application.  There are many large Ruby on Rails sites that do just fine with the "slower interpreted" language.  When you get to scaling out web apps there are many more pressing performance issues than the speed of the language you are writing it in.</p>\n'}, {'answer_id': 26241, 'author': 'Mike Deck', 'author_id': 1247, 'author_profile': 'https://Stackoverflow.com/users/1247', 'pm_score': 2, 'selected': False, 'text': '<p>If scalability and performance are really important to you you can also check out <a href="http://www.rubyenterpriseedition.com" rel="nofollow noreferrer">Ruby Enterprise Edition</a>.  It\'s a custom implementation of the Ruby interpreter that\'s supposed to be much better about memory allocation and garbage collection.  I haven\'t seen any objective metrics comparing it directly to JRuby, but all of the anectdotal evidence I\'ve heard has been very very good.</p>\n\n<p>This is from the same company that created <a href="http://www.modrails.com/" rel="nofollow noreferrer">Passenger (aka mod_rails)</a> which you should definitely check out as a rails deployment solution if you decide not to go the JRuby route.</p>\n'}, {'answer_id': 36409, 'author': 'asussex', 'author_id': 3796, 'author_profile': 'https://Stackoverflow.com/users/3796', 'pm_score': 0, 'selected': False, 'text': '<p>Check out "Writing Efficient Ruby Code" from Addison Wesley Professional:</p>\n\n<p><a href="http://safari.oreilly.com/9780321540034" rel="nofollow noreferrer">http://safari.oreilly.com/9780321540034</a></p>\n\n<p>I found some very helpful and interesting insights in this short work. And if you sign up for the free 10-day trial you could read it for free. (It\'s 50 pages and the trial gets you (AFAIR) 100 page views.)</p>\n\n<p><a href="https://ssl.safaribooksonline.com/promo" rel="nofollow noreferrer">https://ssl.safaribooksonline.com/promo</a></p>\n'}, {'answer_id': 47410, 'author': 'Johannes Passing', 'author_id': 4372, 'author_profile': 'https://Stackoverflow.com/users/4372', 'pm_score': 0, 'selected': False, 'text': "<p>I am not a Ruby programmer but I have been pretty tightly involved in a JRuby deployment lately and can thus draw some conclusions. Do not expect to much from JRuby's performance. In interpreted mode, it seems to be somewhere in the range of C Ruby. JIT mode <em>might</em> be faster, but only in theory. In practice, we tried JIT mode on Glassfish for a decently-sized Rails application on a medium-sized server (dual core, 8GB RAM). And the truth is, the JITting took so <em>freakingly</em> much time, that the server needed 20-30 minutes before it answered the first request. Memory usage was astronomic, profiling did not work because the whole system grinded to halt with a profiler attached.</p>\n\n<p>Bottom line: JRuby has its merits (multithreading, solid platform, easy Java integration), but given that interpreted mode is the only mode that worked for us in practice, it may be expected to be no better performance-wise than C Ruby.</p>\n"}, {'answer_id': 47425, 'author': 'Ian', 'author_id': 4396, 'author_profile': 'https://Stackoverflow.com/users/4396', 'pm_score': -1, 'selected': False, 'text': "<p>I'd second the recommendation of the use of Passenger - it makes deployment and management of Rails applications trivial</p>\n"}]
['https://Stackoverflow.com/questions/25950', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1693/']