develooper Front page | perl.perl5.porters | Postings from April 2003

Re: [patch] probable Unicode speed trap solution

Thread Previous | Thread Next
Rafael Garcia-Suarez
April 14, 2003 14:38
Re: [patch] probable Unicode speed trap solution
Message ID:
Pradeep Hodigere wrote:
>  perldoc perlunicode's speed section mentions the
> slowness of length(), substr() and index() functions
> when handling UTF-8 encoded strings. A mail thread
> titled 'Unicode speed trap' discusses probable
> solutions to this problem.
>    I have an implementation that might be a solution
> to this issue and have attached a patch for the same.
> The patch brought about a sizeable performance
> improvement in length() and substr() functions. 

Thanks a lot for your work, but it appears that Jarkko Hietaniemi has
already worked on this problem, and has implemented a slightly more
sophisticated solution as change #18353.

Of course, what would be helpful, if you're inclined, is to read
Jarkko's code and try to find holes in it -- as he says, "code this
hairy is bound to have hairy trolls hiding under it". One of the ways
to achieve this is to write tests, if you feel that some part of it
is not thoroughly tested.

See for further reference :
and the perlhack manpage, if you want to get the development version of

Unofficial is not *NIX

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