CArray creation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use v6; | |
| use Bench; | |
| use NativeCall; | |
| my $b = Bench.new; | |
| my $small = Buf.new(0 xx 100); | |
| my $medium = Buf.new(0 xx 1000); | |
| my $large = Buf.new(0 xx 10000); | |
| $b.timethese(1000, { | |
| empty => { CArray[uint8].new }, | |
| sml-clas => { CArray[uint8].new($small.list) }, | |
| med-clas => { CArray[uint8].new($medium.list) }, | |
| lge-clas => { CArray[uint8].new($large.list) }, | |
| }); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ perl6 -v | |
| This is Rakudo version 2015.12 built on MoarVM version 2015.12 | |
| implementing Perl 6.c. | |
| [sog@monica Blob]$ perl6 benchCA.pl6 | |
| Benchmark: | |
| Timing 1000 iterations of empty, lge-clas, med-clas, sml-clas... | |
| empty: 0.0240 wallclock secs @ 41743.6036/s (n=1000) | |
| lge-clas: 27.9823 wallclock secs @ 35.7369/s (n=1000) | |
| med-clas: 2.8243 wallclock secs @ 354.0723/s (n=1000) | |
| sml-clas: 0.3700 wallclock secs @ 2702.5661/s (n=1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ perl6 -v | |
| This is Rakudo version 2016.02-100-g4a0ba74 built on MoarVM version 2016.02-8-ga329e2d | |
| implementing Perl 6.c. | |
| [sog@monica Blob]$ perl6 benchCA.pl6 | |
| Benchmark: | |
| Timing 1000 iterations of empty, lge-clas, med-clas, sml-clas... | |
| empty: 0.0248 wallclock secs @ 40267.1151/s (n=1000) | |
| lge-clas: 613.7717 wallclock secs @ 1.6293/s (n=1000) | |
| med-clas: 89.0139 wallclock secs @ 11.2342/s (n=1000) | |
| sml-clas: 9.0680 wallclock secs @ 110.2779/s (n=1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment