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

Re: [patch] probable Unicode speed trap solution

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
April 14, 2003 14:38
Subject:
Re: [patch] probable Unicode speed trap solution
Message ID:
20030414234216.0de9ebd5.rgarciasuarez@free.fr
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 :
   http://archive.develooper.com/perl5-changes%40perl.org/msg06360.html
   http://use.perl.org/article.pl?sid=03/04/14/1129241
and the perlhack manpage, if you want to get the development version of
perl.

-- 
Unofficial is not *NIX

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