Just another Perl shrine | |
PerlMonks |
Re: Faster way to do this?by choroba (Cardinal) |
on Nov 12, 2015 at 16:55 UTC ( [id://1147594]=note: print w/replies, xml ) | Need Help?? |
This seems a bit faster:
On my machine:
I tested various other approaches ($count += () = /M+/g, split), but your original's speed was always the same or better. Update: It seems to scale better with longer inputs, for 15K string, it shows 280%.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
In Section
Seekers of Perl Wisdom
|
|