Message from discussion For performance, write it in C
Subject: Re: For performance, write it in C
Date: Wed, 26 Jul 2006 18:40:24 +0900
Organization: Service de news de lacave.net
X-Trace: talisker.lacave.net 1153906857 36739 22.214.171.124 (26 Jul 2006 09:40:57 GMT)
NNTP-Posting-Date: Wed, 26 Jul 2006 09:40:57 +0000 (UTC)
X-received-from: This message has been automatically forwarded from
the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is
SPAM, it did not originate at comp.lang.ruby. Please report the
original sender, and not us. Thanks!
Please see http://hypermetrics.com/rubyhacker/clrFAQ.html#tag24 to.
Peter Hickman gave a very good article about prototyping in a scripting
language, and then re-coding in c:
> If you really really want that performance boost then take the following
> advice very seriously - "Write it in C".
I totally agree that with the current state of the art, this is the
Maybe it doesn't need saying, but I'm going to... in the vasy majority
of applications, almost all of their run time is a tiny wee small
fraction of the code. This is the part that I would write in c (or c++).
The vast majority of the code (and it's not there just for fun, it's
still completely important to the application) will use a vanishingly
small fraction of processor time. This is the bit that I would probably
leave in Ruby.
People talk about the 80:20 principle, but in my experience it's much
more like 99:1 for applications. 99% of the code uses 1% of the run
time. 1% of the code consumes 99% of the run time. That could be the
signal processing and graphics heavy applications that I have
Thanks for the comparison, it was great. And thanks for the very nice
pre-generation of look up tables in perl idea. Nice.