develooper Front page | perl.perl5.porters | Postings from December 2008

Re: Even faster Unicode character counting

Thread Previous | Thread Next
karl williamson
December 24, 2008 11:57
Re: Even faster Unicode character counting
Message ID:
David Nicol wrote:
> On Tue, Dec 23, 2008 at 5:51 AM, Nicholas Clark <> wrote:
>> Jarkko alerted me to this
>> which references our very own Aristotle Pagaltzis.
>> Is anyone interested in experimenting with his bit-smashing approach and
>> seeing whether it can be used in Perl_utf8_length(), and what sort of a
>> speedup it gives? It's not the world's largest function:
> That was fun.  The attached patch should be faster than Colin
> Percivals because we're not checking for zero bytes all the time, and
> the Duff's device to avoid most of the length checks.
The pre-existing function works on UTF-EBCDIC.  It appears to me that 
this patch does not, which is fine as long as it's #ifdef'd.

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