Re: invalidly encoded strings

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: invalidly encoded strings
Дата
Msg-id 46E3DD0B.6080900@dunslane.net
обсуждение исходный текст
Ответ на Re: invalidly encoded strings  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers

Martijn van Oosterhout wrote:
> On Sun, Sep 09, 2007 at 12:02:28AM -0400, Andrew Dunstan wrote:
>   
>> . what do we need to do to make the verification code more efficient? I 
>> think we need to address the correctness issue first, but doing so 
>> should certainly make us want to improve the verification code. For 
>> example, I'm wondering if it might benefit from having a tiny cache.
>>     
>
> It has been pointed out the the verification for UTF-8 is very
> inefficient, involving several function calls to first get the length,
> then check characters, etc. It could be significantly improved. I don't
> know whether a cache would make any useful difference.
>
>
>   

Well, it looks to me like "several" = 2. If function call overhead is 
the worry, we could either create inline versions of pg_utf_mblen and 
pg_utf8_islegal and rely on the compiler to make things good for us, or 
inline the calls directly ourselves. Either way there's some 
duplication, since the whole "extern inline" thing is still a mess. I'd 
be inclined to do the inlining by hand since it's not that much code and 
it would be more portable. Unless I'm missing something it should be a 
10 minute c&p job.

Is that all we're worried about?

cheers

andrew


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: invalidly encoded strings
Следующее
От: Tom Lane
Дата:
Сообщение: Re: invalidly encoded strings