From: gabriele renzi Date: 2005-04-06T02:19:40+09:00 Subject: Re: Benchmarking whole programs Dick Davies ha scritto: >>I don't know. Does the benchmark package take startup time into >>account? You can always reverse the tests to ensure that they aren't >>being tainted by startup time couldn't you? yup, I was thinking of doing the same, but see later >>Another thing you can do is to run your implementation through the >>profiler. I also see ruby-prof on the RAA which you could try. I recall rbprof as part of the AspectR distribution, not sure if it still works. Anyhow, again, see later.. > For those who don't know - > Don't use that for a walltime, it slows things right down. > > For a full app, what's wrong with > > time first_impl.rb > time second_impl.rb nothing, actually, even if I think that should be something like time first_impl.rb time first_impl.rb time first_impl.rb time second_impl.rb time second_impl.rb time second_impl.rb to warm up the cache :) And nothing is wrong with the ideas that Daniel Berger pointed out, I was just wondering if there was something builtin in ruby's benchmark.rb or if people had wrote something like this, since it seem something quite common to think about. Some changes like "use an array instead of a whole class" or "use two structs and a mixin instead of two classes", I mean, stuff that changes larger things that simple methods, are imho quite common, and even if probably the timing differences could be unvaluable it would be interesting to look at them :) Thanks both.