-
-
Save jnthn/c739b869378133ccb09d to your computer and use it in GitHub Desktop.
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
sub fib($n) { | |
$n <= 1 ?? 1 !! fib($n - 2) + fib($n - 1) | |
} | |
for 1..10 -> $degree { | |
my $start = now; | |
my @fibs = await (start { fib(25) }) xx $degree; | |
say "$degree: {now - $start}"; | |
die "Oops!" unless [==] @fibs; | |
} |
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
1: 1.0476326 # baseline cost | |
2: 1.1106408 | |
3: 1.2746614 | |
4: 1.30716571 # number of physical cores | |
5: 1.4821886 | |
6: 1.6322063 | |
7: 1.6427082 | |
8: 1.9857531 # number of virtual cores | |
9: 3.262914 | |
10: 3.3859285 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment