Created
February 1, 2017 11:41
-
-
Save samcv/3bf513759424aae24ae32fa616c278ff 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
use nqp; | |
#proto sub infix:<unicmp>(Str \a, Str \b) is pure { * } | |
my %decomp_spec; | |
my @list; | |
my @dec = "ABC", "04D", "ABC", "04D"; | |
# 1.5s | |
for ^10000 -> $cp { | |
my @array; | |
push %decomp_spec{$cp}<mapping>, nqp::atpos(nqp::radix(16, $_, 0, 0), 0) for @dec; | |
} | |
# 0.5s | |
for ^10000 -> $cp { | |
my @array; | |
for @dec { @array.push(nqp::atpos(nqp::radix(16, $_, 0, 0), 0)) } | |
%decomp_spec{$cp}<mapping> = @array; | |
} | |
say now - INIT now; | |
say %decomp_spec; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment