From: mathew Date: 2005-09-30T14:21:44+09:00 Subject: Re: Relative speed of Ruby vs Java for a large compiled app like Freenet William Morgan wrote: > Probably the best idea for this type of thing is to write a base Freenet > library in C (if one doesn't exist already!), and do the higher-level > behavior in Ruby. I disagree. I think the best idea is to write the whole thing in Ruby, then profile it, then optimize the slow bits, then measure it again, then rewrite the slow bits in C if it still isn't fast enough. In other words, use C as a last resort, not a first resort. The problem is that there's no guarantee that the base Freenet functionality will turn out to be the performance bottleneck; and even if the bottleneck is somewhere in there, chances are the slowness will be concentrated in one or two key functions, and there's no need to write the lot in C. In general, humans are very bad at predicting which bits of code will be the slow bits. Hence it's a good idea to write clean, simple code, measure it, and only then decide where to optimize. Google: "premature optimization" mathew -- WE HAVE TACOS