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 *NIXThread Previous | Thread Next