Skip Menu |

This queue is for tickets about the SPVM CPAN distribution.

Report information
The Basics
Id: 123188
Status: open
Priority: 0/
Queue: SPVM

People
Owner: KIMOTO [...] cpan.org
Requestors: DONANGEL [...] cpan.org
Cc: an.gorohovski [...] gmail.com
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



CC: an.gorohovski [...] gmail.com
Subject: SPVM is slow and incorrectly calculates
Hi Kimoto, Sorry, I have tested/checked your module and got following results for array [1..100_000]. 1) Your module (see your example) wuth my $sp_nums = SPVM::new_int_array( [ 1..100_000 ] ); is: $ time ./SPVM-Native_example.pl 705082704 real 0m0.241s user 0m0.216s sys 0m0.020s 2) A sample pure perl: $ time perl -E '$t += $_ for 1..100_000; say $t' 5000050000 real 0m0.018s user 0m0.016s sys 0m0.004s Yes, Sum of from 1 to 100_000 is 100_000*100_001/2 = 5000050000 What do you think ?
Subject: Re: [rt.cpan.org #123188] SPVM is slow and incorrectly calculates
Date: Fri, 6 Oct 2017 23:10:20 +0900
To: bug-SPVM [...] rt.cpan.org
From: Yuki Kimoto <kimoto.yuki [...] gmail.com>
new_int_array is data conversion function, not calculate total value. If you want to calculate total of 1..100_000, please write the following. # lib/Foo.spvm package Foo { sub sum() : void { my $total = 0; for (my $i = 0; $i < 100_000; $i++) { $total += $i; } std::say_int($total); } } 2017-10-04 17:23 GMT+09:00 Alessandro Gorohovski via RT < bug-SPVM@rt.cpan.org>: Show quoted text
> Wed Oct 04 04:23:15 2017: Request 123188 was acted upon. > Transaction: Ticket created by DONANGEL > Queue: SPVM > Subject: SPVM is slow and incorrectly calculates > Broken in: (no value) > Severity: Critical > Owner: KIMOTO > Requestors: DONANGEL@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=123188 > > > > Hi Kimoto, > > Sorry, I have tested/checked your module and got following results > for array [1..100_000]. > > 1) > Your module (see your example) wuth > my $sp_nums = SPVM::new_int_array( [ 1..100_000 ] ); > is: > $ time ./SPVM-Native_example.pl > 705082704 > > real 0m0.241s > user 0m0.216s > sys 0m0.020s > > 2) > A sample pure perl: > $ time perl -E '$t += $_ for 1..100_000; say $t' > 5000050000 > > real 0m0.018s > user 0m0.016s > sys 0m0.004s > > Yes, > Sum of from 1 to 100_000 is 100_000*100_001/2 = 5000050000 > > What do you think > ? >
Hi Kimoto, Птн Окт 06 10:11:19 2017, kimoto.yuki@gmail.com писал: Show quoted text
> new_int_array is data conversion function, not calculate total value. >
Perhaps, but its results are erroneous and slower than the pure Perl. Show quoted text
> If you want to calculate total of 1..100_000, please write the following. > > # lib/Foo.spvm > package Foo { > sub sum() : void { > my $total = 0; > for (my $i = 0; $i < 100_000; $i++) { > $total += $i; > } > std::say_int($total); > } > }
Here too the result turns out bad 704982704 :( Please to check by yourself. Show quoted text
> > 2017-10-04 17:23 GMT+09:00 Alessandro Gorohovski via RT < > bug-SPVM@rt.cpan.org>: >
> > Wed Oct 04 04:23:15 2017: Request 123188 was acted upon. > > Transaction: Ticket created by DONANGEL > > Queue: SPVM > > Subject: SPVM is slow and incorrectly calculates > > Broken in: (no value) > > Severity: Critical > > Owner: KIMOTO > > Requestors: DONANGEL@cpan.org > > Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=123188 > > > > > > > Hi Kimoto, > > > > Sorry, I have tested/checked your module and got following results > > for array [1..100_000]. > > > > 1) > > Your module (see your example) wuth > > my $sp_nums = SPVM::new_int_array( [ 1..100_000 ] ); > > is: > > $ time ./SPVM-Native_example.pl > > 705082704 > > > > real 0m0.241s > > user 0m0.216s > > sys 0m0.020s > > > > 2) > > A sample pure perl: > > $ time perl -E '$t += $_ for 1..100_000; say $t' > > 5000050000 > > > > real 0m0.018s > > user 0m0.016s > > sys 0m0.004s > > > > Yes, > > Sum of from 1 to 100_000 is 100_000*100_001/2 = 5000050000 > > > > What do you think > > ? > >