From: Francis Cianfrocca Date: 2006-07-26T21:53:17+09:00 Subject: Re: For performance, write it in C ------=_Part_155098_5561176.1153918392789 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline One important thing about Ruby performance is that Ruby gets very inefficient very quickly, as the size of the working set grows. This manifests as an observed performance problem, but the tip-off is that performance of a particular Ruby program is quite acceptable for small data-set sizes (such as in your test fixtures), but falls off a cliff with production data-sets. Most of the times that I have found myself rewriting slow Ruby code in C have been to get a program that runs in far less memory, by manually laying out the data structures. This improves performance not only for the obvious reasons (less thrashing and less contention with other processes on a busy server), but also because you can "help" the processor's cache manager to get more hits by creating localities of reference and by stuffing more of your working set into a smaller number of cache lines. This matters all the more on multiprocessors, which are severely penalized by cache misses, to the point that some naively-written programs can run noticeably faster on a uniprocessor. ------=_Part_155098_5561176.1153918392789--