/mobile Handheld Friendly website

 performance measurements

Each table row shows performance measurements for this Perl program with a particular command-line input value N.

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load

Read the ↓ make, command line, and program output logs to see how this program was run.

Read mandelbrot benchmark to see what this program should do.

 notes

This is perl 5, version 18, subversion 0 (v5.18.0) built for x86_64-linux-thread-multi

Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
                        PERL_DONT_CREATE_GVSV
                        PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
                        PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_ALL
                        USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
                        USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
                        USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
                        USE_REENTRANT_API

 mandelbrot Perl #2 program source code

# The Computer Language Shootout
# http://benchmarksgame.alioth.debian.org/
# implemented by Greg Buchholz
# streamlined by Kalev Soikonen

sub ITER ()	{ 50 }
sub LIMITSQR ()	{ 2.0 ** 2 }

my ($w, $h, $i);
my ($Cr, $Ci, $Zr, $Zi, $Tr, $Ti);

sub dot {
    $Cr = 2 * $_[0] / $w - 1.5;
    $Ci = 2 * $_[1] / $h - 1.0;

    $Zr = $Zi = $Tr = $Ti = 0.0;
    $i = ITER;
    (
	$Zi = 2.0 * $Zr * $Zi + $Ci,
	$Zr = $Tr - $Ti + $Cr,
	$Ti = $Zi * $Zi,
	$Tr = $Zr * $Zr
    ) until ($Tr + $Ti > LIMITSQR || !$i--);
    return ($i == -1);
}

$w = $h = shift || 80;
print "P4\n$w $h\n";
for my $y (0..$h-1) {
    print pack 'B*', pack 'C*', map dot($_, $y), 0..$w-1;
}

 make, command-line, and program output logs

Mon, 04 Feb 2013 07:02:49 GMT

COMMAND LINE:
/usr/local/src/perl-5.16.2/bin/perl mandelbrot.perl-2.perl 16000

(BINARY) PROGRAM OUTPUT NOT SHOWN

Revised BSD license

  Home   Conclusions   License   Play