Skip to content

Instantly share code, notes, and snippets.

@smls

smls/ip_bench.p6 Secret

Created December 19, 2015 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smls/5626453188e4e20eef2b to your computer and use it in GitHub Desktop.
Save smls/5626453188e4e20eef2b to your computer and use it in GitHub Desktop.
sub ip-to-number ($ip) {
do given $ip.split('.') {
.[0] +< 24 +
.[1] +< 16 +
.[2] +< 8 +
.[3]
}
}
my @inputs = |('127.0.0.1', '255.255.255.0') xx 10000;
my $time = now;
for @inputs {
say ip-to-number($_);
}
note now - $time;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment