[Shootout-list] Timing issues
Isaac Gouy
igouy2@yahoo.com
Sun, 5 Sep 2004 08:54:08 -0700 (PDT)
Comparison timings made with Time::HiRes and BSD::Resource for the same
program run of Sieve n=100 n=1000.
(usr+sys should always be greater than wallclock)
wallclock usr+sys
GCC 100 0.059462 0.0500000000000003
GCC 100 0.057778 0.0499999999999998
GCC 100 0.057762 0.0600000000000003
GCC 100 0.057752 0.0600000000000001
GCC 100 0.057588 0.0599999999999998
GCC 1000 0.510601 0.51
GCC 1000 0.51086 0.51
GCC 1000 0.510873 0.51
GCC 1000 0.51069 0.51
GCC 1000 0.510719 0.51
OO2C 100 0.03297 0.04
OO2C 100 0.033204 0.0300000000000002
OO2C 100 0.03313 0.0299999999999996
OO2C 100 0.033074 0.04
OO2C 100 0.033288 0.0300000000000002
OO2C 1000 0.222999 0.22
OO2C 1000 0.223304 0.23
OO2C 1000 0.223128 0.220000000000001
OO2C 1000 0.225433 0.23
OO2C 1000 0.223023 0.22
Mono 100 0.271137 0.05
Mono 100 0.241688 0.05
Mono 100 0.245944 0.23
Mono 100 0.272433 0.24
Mono 100 0.269268 0.25
Mono 1000 0.981131 0.0599999999999999
Mono 1000 0.980149 0.04
Mono 1000 0.979636 0.04
Mono 1000 0.987423 0.95
Mono 1000 0.987873 0.95
Perl 100 2.103866 2.1
Perl 100 2.112628 2.12
Perl 100 2.116768 2.11
Perl 100 2.104801 2.11
Perl 100 2.126303 2.12
Perl 1000 20.892511 20.89
Perl 1000 20.895478 20.89
Perl 1000 20.939512 20.94
Perl 1000 20.950427 20.95
Perl 1000 20.865542 20.86
print " wallclock usr+sys\n";
$t0 = [gettimeofday];
my($cu0, $cs0) = (BSD::Resource::times)[2,3];
unless (defined ($pid = fork)) {die "cannot fork: $!"; }
unless ($pid) { exec 'perl sieve.perl 100 > null'; exit; }
wait();
$t1 = [gettimeofday];
my($cu1, $cs1) = (BSD::Resource::times)[2,3];
$cu1 -= $cu0;
$cs1 -= $cs0;
$c = $cu1 + $cs1;
$t = tv_interval $t0, $t1;
print "Perl 100 $t $c \n";
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail