?

Log in

No account? Create an account
Perl Developer's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Saturday, August 12th, 2017

Time Event
1:30a
MoarVM performance

=================1=====================
$time perl -e 'my $x=0; $x++ while $x < 300000000; print $x;'
300000000
real 0m12.047s
user 0m12.040s
sys 0m0.000s
=================2=====================
$perl6 -v
This is Rakudo version 2017.07 built on MoarVM version 2017.07
implementing Perl 6.c.
=================3=====================
$time perl6 -e 'my $x=0; $x++ while $x < 300000000; print $x;'
300000000
real 0m46.730s
user 0m46.664s
sys 0m0.024s
=================4=====================
$time perl6 -e 'my Int $x=0; $x++ while $x < 300000000; print $x;'
300000000
real 0m46.925s
user 0m46.840s
sys 0m0.028s
=================5=====================
$time perl6 -e 'my int $x=0; $x++ while $x < 300000000; print $x;'
300000000
real 0m2.390s
user 0m2.356s
sys 0m0.028s
=================6=====================
$time perl6 -e 'my uint $x=0; $x++ while $x < 300000000; print $x;'
300000000
real 0m12.103s
user 0m12.060s
sys 0m0.020s
=================7=====================
$time perl6 -e 'say (1..300000000).elems'
300000000
real 0m0.165s
user 0m0.144s
sys 0m0.020s
=================8=====================
$time perl -e '$s+=$x++ while $x < 30000000; print $s;'
449999985000000
real 0m2.336s
user 0m2.332s
sys 0m0.000s
=================9=====================
$time perl6 -e 'my int $x=0; my int $s=0; $s+=$x++ while $x < 30000000; say $s;'
449999985000000
real 0m17.609s
user 0m16.640s
sys 0m0.948s
=================10=====================
$time perl6 -e 'my uint $x=0; my uint $s=0; $s+=$x++ while $x < 30000000; say $s;'
449999985000000
real 0m21.325s
user 0m20.320s
sys 0m0.964s
=================11=====================
$time perl6 -e 'say [+] 1..29999999'
449999985000000
real 0m0.164s
user 0m0.124s
sys 0m0.036s

Мораль:  элементы быстродействия присутствуют, но странностей много (5 vs 6 и 8 vs 9)

<< Previous Day 2017/08/12
[Calendar]
Next Day >>
About LiveJournal.com