develooper Front page | perl.perl5.porters | Postings from September 2010

[perl #76674] [PATCH] Locale::Maketext - speed and efficiency tweaks

Thread Next
Father Chrysostomos via RT
September 26, 2010 17:28
[perl #76674] [PATCH] Locale::Maketext - speed and efficiency tweaks
Message ID:
On Thu Jul 22 11:09:33 2010, wrote:
> This patch resolves CPAN RT #48118 of the same name.
> The change checks for [ in the string before it attempts to compile
>    it. If [ is not found, it is able to bypass compile. We've found
>    that this change benchmarked 9% faster in our code.

In my experience, $a !~ /\[/ is faster than $a !~ y/[//, because the
former can stop when it finds a [ and doesn’t have to keep count the way
y/// does.

Using Steffen Mueller’s dumbbench script, I confirmed that /\[/ takes
longer to compile, but y/[// takes longer to run.

Also, from reading the source (not actually testing this) it seems that
your patch stops an unmatched clasing bracket from being an error. Am I
right about this?

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About