Created
April 8, 2017 07:55
-
-
Save samcv/2aac7ec4ad19129365ee95bcb6a4aae4 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
my $tA = now; say 'a' x 1000000000 ~ 'b' ~~ /b/; note 'A ' ~ now - $tA; | |
my $tB = now; say 'a' x 1000000000 ~ 'b' ~~ /aaabcde/; note 'C ' ~ now - $tB; | |
my $tC = now; say 'a' x 1000000000 ~ 'b' ~~ /abcde/; note 'B ' ~ now - $tC; | |
# If you have time: | |
my $var1 = 'a' x 1000000000 ~ 'b'; my $ta = now; use nqp; nqp::index($var1, 'b', 0); note 'a ' ~ now - $ta; | |
my $var2 = 'a' x 1000000000 ~ 'b'; my $tb = now; use nqp; nqp::index($var2, 'abcde', 0); note 'b ' ~ now - $tb; | |
my $var3 = 'a' x 1000000000 ~ 'b'; my $tc = now; use nqp; nqp::index($var3, 'aaabcde', 0); note 'c ' ~ now - $tc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment