Skip to content

Instantly share code, notes, and snippets.

@Tekki
Created November 18, 2018 10:34
Show Gist options
  • Save Tekki/4d8914d69e673bce82b8e8d435323897 to your computer and use it in GitHub Desktop.
Save Tekki/4d8914d69e673bce82b8e8d435323897 to your computer and use it in GitHub Desktop.
Perl 6 Speedtest
#!/usr/bin/env perl6
class Point {
has $.x;
has $.y;
}
my $total = 0;
for ^100_000_000 {
my $p = Point.new(x => 2, y => 3);
$total = $total + $p.x + $p.y;
}
say $total;
@Tekki
Copy link
Author

Tekki commented Nov 18, 2018

Download this script and compare different versions using Docker:

docker image pull rakudo-star:2018.06
docker image pull rakudo-star:2018.10
time docker container run --rm -v "$(pwd):/script" rakudo-star:2018.06 perl6 /script/speedtest.p6
time docker container run --rm -v "$(pwd):/script" rakudo-star:2018.10 perl6 /script/speedtest.p6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment