> Thanks for the numbers!
> 
Here's some more tests..

I did the same test using perl, and its native .. range operator:

        50000           100000          200000          400000
        20001-70000     20001-120000    20001-220000    20001-420000
REBOL    5s             10s             20s             41s
Perl     1s              3s              8s             15s

        100001          100001
        -50000 - 50000  -150000 - 50000
REBOL   10s             10s
Perl     5s              4s

I can run a test in assembly language too, but I think it will be too
fast to be timed even with 400000 values...

Maybe REBOL could need a native range operator anyway (I've seen that
discussion some time ago) ?

/PeO

> [EMAIL PROTECTED] wrote:
> > 
> > > Hi, peoyli,
> > >
> > ...
> > >
> > > It would be interesting to have you try a couple of the above options
> > > along with your original  for  version and post the timings, if you
> > > have the spare time.
> > >
> > > -jn-
> > 
> > Ok,,
> > 
> > here comes my test results, along with the code being tested..
> > 
#!/usr/local/bin/perl

intblock(20001, 25000);
intblock(20001, 70000);
intblock(20001, 120000);
intblock(20001, 220000);
intblock(20001, 420000);
intblock(-50000, 50000);
intblock(-150000, -50000);


sub intblock
{
  my($min,$max) = @_;
  local($len_a,$tim1);

  $tim1 = time();
  @a = ($min..$max);
  print "\nElapsed time: ", time() - $tim1, " seconds\n";

  $len_a = @a;
  print "Size of array: $len_a\n";
  print "Array's first value: $a[0]\n";
  print "Array's last value: $a[$len_a - 1]\n";
}

Reply via email to