[ create a new paste ] login | about

Link: http://codepad.org/beTC6TQr    [ raw code | fork ]

C, pasted on Dec 3:
############################################
# perl 5.10: 5.50s
$i=1e8;--$i for(0..1e8)

############################################
# parrot assembly
# uncompiled: 7.43s
# parrot bytecode, unoptimized: 7.12s
# parrot bytecode, -O2: 6.90s

set I0, 1e8

RECURSE:
    dec I0

if I0, RECURSE

end

############################################
# Ruby: 12.5s
1.upto(1e8) {};

############################################
# Python: 12.28s
y = 100000000
for x in xrange(100000000):
    y -= 1

############################################
# C: 0.23s
# C, -O3: 0.12s
int main() {int i, j; i = 1e8; j = 0; for (j=0;j < 1e8; j++) {i -= j;}}

############################################
# Parrot PIR: 6.92s
# PIR -R fast: 4.10s
# PIR Bytecode: 7.05s
# PIR Bytecode -R fast: 4.15s

.sub 'main' :main
    $I0 = 1e8

loop:
    dec $I0
    if $I0, loop
    
.end

############################################
# Parrot PIR-OO: 28.93s
# Parrot PIR-OO -R fast: 25.54s
# Parrot PIR-OO -R fast -O2: 25.37s
# bytecode: 28.92s
# bytecode -R fast -O2: 25.87s

.sub 'main' :main
    $P0 = new 'Integer'
    $P0 = 100000000

loop:
    dec $P0
    ne $P0, 0, loop
    
.end


Create a new paste based on this one


Comments: