Skip to content

Instantly share code, notes, and snippets.

@scmorrison
Last active December 7, 2018 10:45
Show Gist options
  • Save scmorrison/0cabe5436273c83b6608a8e838b70989 to your computer and use it in GitHub Desktop.
Save scmorrison/0cabe5436273c83b6608a8e838b70989 to your computer and use it in GitHub Desktop.
Tests for 6Pad
my $input = 'While there was a brief hiatus in the development of the open firmware for Raspberry Pi, we can now boot Linux straight from bootcode.bin (note, this does require an initrd built in with zImage as there are still issues with eMMC working reliably at boot).';
my @input_arr = $input.comb;
my $i = 0;
my %working_set;
# example 1: rotor
my $now = now;
@input_arr.rotor(5 => -4).map: -> @set {
%working_set{'a', 'b', 'c', 'd', 'e'} = @set;
say %working_set.perl;
}
say "Example 1 runtime: {now - $now}";
# example 2: while
$now = now;
while $i < @input_arr.elems {
%working_set{'a', 'b', 'c', 'd'} = @input_arr[$i..$i+3];
say %working_set.perl;
$i++;
}
say "Example 2 runtime: {now - $now}";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment