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

Re: Even faster Unicode character counting

Thread Previous | Thread Next
From:
David Nicol
Date:
December 24, 2008 10:19
Subject:
Re: Even faster Unicode character counting
Message ID:
934f64a20812241019n1280f20dw1aedc42d0a135fd8@mail.gmail.com
On Tue, Dec 23, 2008 at 5:51 AM, Nicholas Clark <nick@ccl4.org> wrote:
> Jarkko alerted me to this
>    http://www.daemonology.net/blog/2008-06-05-faster-utf8-strlen.html
>
> 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.


-- 
"Time is nothing to a cat when he is dancing" --
http://www.amazon.com/exec/obidos/ISBN=1590170474/tipjartransactioA

Thread Previous | 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