From: "Brian Schröder" Date: 2005-09-11T17:07:54+09:00 Subject: Re: Better Random benchmark - need help with profiling On 11/09/05, Martin Jansson wrote: > On Sat, 10 Sep 2005 21:34:44 +0200, Brian Schr�der > [snip] > > Shroeder! What version of Ruby do you use? > $ ruby -v ruby 1.8.3 (2005-06-23) [i486-linux] > I did something similar in one of my many versions. And it is the oo thing > to do. > (I haven't actually benchmarked puts vs printf, I will do that ;) > > It's not faster on my system. That may be proof that profiling is a bad > thing and that we all should prove our code mathematically (shudder). If you look at the benchmark I provided, it is a bit slower on my system too. But it is a lot prettier IMHO. I just tried rewriting the thing in nice ruby, because thats what ruby is for. Otherwise just write a c extension and do require 'random.so" or even better just use the builtin mersenne twister (Kernel#rand) > [snip] > > I have a lot of white noise on my system, so I haven't used Rubys > benchmark thingie much. It would be more useful to me if it could do > matched pair sampling (is that the correct English term?) and/or throw > away extreme values. > If the noise is really white, you just need to sample often enough. It will average out. hope to help, Brian -- http://ruby.brian-schroeder.de/ Stringed instrument chords: http://chordlist.brian-schroeder.de/