bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bracket expressions with character ranges are slow


From: Paolo Bonzini
Subject: Re: Bracket expressions with character ranges are slow
Date: Wed, 18 May 2011 19:29:42 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 05/09/2011 12:58 AM, Seth David Schoen wrote:
Thanks, that's definitely the source of the problem.  I appreciate
the explanation.  I did some more tests with this and found that
searches with bracket expressions in my UTF-8 locale are slow when
the elements inside the brackets contain both a single-byte character
and a multi-byte character.  So [ab], [üçå], [美国], and [ł天] are all
fast, but [人a] and [aö] are quite slow.

Maybe I need to think more about how UTF-8 works, but I don't quite
see why these bracket expressions need to be as slow as they are.

You are correct that these cases (unlike ranges) can be optimized.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]