Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Faster regex to split a string into runs of similar characters?

by Eily (Monsignor)
on Nov 21, 2016 at 13:27 UTC ( [id://1176246]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Benchmark qw( cmpthese );
    
    $s = join'', map{ chr( 65+rand(26) ) x rand( 100 ) } 1 .. 1000;;
    ...
        ] ,
        c=>q[$s3 = " $s" ^ $s;; 1 while $s3 =~ /(.\o{0}*)/gs],
    };;
    
  2. or download this
    55  97  65  7   87  60  53  98  2   71  35  68  67  58  12  19  17  22
    +  5   28  63  96  30  18  32  6   37  27  47  68  79  97  2   9   60 
    + 75  87  31  15  82  62  78  33  69  10  35  4   82  61  33  63  82  
    +96  68  140
    88  59  67  87  78  98  14  3   6   52  59  74  86  79  49  44  28  76
    +  25  83  99  66  42  67  73  3   46
    
    55  97  65  7   87  60  53  98  2   71  35  68  67  58  12  19  17  22
    +  5   28  63  96  30  18  32  6   37  27  47  68  79  97  2   9   60 
    + 75  87  31  15  82  62  78  33  69  10  35  4   82  61  33  63  82  
    +96  68  140
    88  59  67  87  78  98  14  3   6   52  59  74  86  79  49  44  28  76
    +  25  83  99  66  42  67  73  3   46  1
    
  3. or download this
        Rate    a    b    c
    a  445/s   --  -4% -80%
    b  465/s   5%   -- -79%
    c 2228/s 401% 379%   --
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1176246]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2024-04-18 16:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found