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

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

Thread Next
From:
Father Chrysostomos via RT
Date:
September 26, 2010 17:28
Subject:
[perl #76674] [PATCH] Locale::Maketext - speed and efficiency tweaks
Message ID:
rt-3.6.HEAD-24759-1285547295-162.76674-15-0@perl.org
On Thu Jul 22 11:09:33 2010, toddr@cpanel.net 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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About