Subj : Revised numbers
To   : Digital Man
From : Amcleod
Date : Fri Mar 16 2001 09:18 pm

RE: Revised numbers
BY: Digital Man to All on Fri Mar 16 2001 11:33 pm

> It would be interesting to see some comparable numbers for VBScript, Tcl, Pe
> and other major scripting languages. I'm sure Angus is probably already work
> on a Perl module (the proverbial "Pandora's Box"?).

Alright, alright.  I can take a hint!

#!/usr/bin/perl -w
# PCMS Bench (only in Perl)

my ($i, $t, $start);                    # int i t start

$i = 0;                                 # set i 0
&clock_sync();                          # call clock_sync
printf "Calculating Performance ...";   # printf "Calculating Performance ..."
while (($t = time()) <= $start) {$i++}  # :loop
                                       #       time t
                                       #       compare start t
                                       #       if_equal
                                       #                add i 1
                                       #                goto loop
                                       #                end_if

#printf "\r\n%lu addition and get-time-of-day operations per second\r\n" i
print "\n$i addition and get-time-of-day operations per second\n";

exit 0;                                 # return

sub clock_sync() {                      # :clock_sync
   printf "Synchronizing clock ...";   # printf "Synchronizing clock ..."
   $t = time();                        # time t
   while (($start = time()) ==  $t) {} # :sync_loop
                                       #         time start
                                       #         compare start t
                                       #         if_equal
                                       #                 goto sync_loop
                                       #                 end_if
   print "\n";                         # crlf
}                                       # return

Fairly literal translation, possibly a ton of Perlesque optimizations that
could be done, but it's too early in the morning for that.  On Zaphod (a
lightly loaded Celeron 500)

   Synchronizing clock ...
   Calculating Performance ...
   671193 addition and get-time-of-day operations per second

Interesting to see what the P-III/700 does.  Also, Rob, you C-fiend you, what
does it look like in C?

Oh, I ran that several times with results all in the 670,000 to 671,000 range b
ut I don't know what averaging and rounding you used.  I think it might be an
idea to run the loop over a longer period, say 10 sec or even more, but I don't
know how to achieve this without loading the loop with additional calculations.
maybe add 10 to $start before the loop begins?  But then $start would become
$stop.....

---
� Synchronet � Vertrauen � Home of Synchronet � telnet://vert.synchro.net