Skip to content

Instantly share code, notes, and snippets.

@MattOates
Last active March 18, 2018 17:12
Show Gist options
  • Save MattOates/d65abcb0b89898c35beea95200c4ea0f to your computer and use it in GitHub Desktop.
Save MattOates/d65abcb0b89898c35beea95200c4ea0f to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl6
my Int $len = 16;
my $maxlen = 32768;
my $how-many =100000;
while $len < $maxlen {
my $start = now;
my int @ones[$len];
for 1..$how-many {
loop (my int $i = 0; $i < $len; $i++) {
@ones[$i] = Bool.roll;
}
my $maxones = @ones.sum;
# say $maxones;
}
say "perl6-BitVector,$len,",now - $start;
$len = $len*2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment