Re: Use bsearch() instead of a manual binary search in syscache.c

Поиск
Список
Период
Сортировка
От cca5507
Тема Re: Use bsearch() instead of a manual binary search in syscache.c
Дата
Msg-id tencent_E18534B54929113201787B07D37676A14E08@qq.com
обсуждение исходный текст
Ответ на Re: Use bsearch() instead of a manual binary search in syscache.c  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
Hi,

Thanks for the explanation which helps me a lot!

The bsearch() got inlined according to compiler explorer:

https://godbolt.org/z/1x69zGMcn

So we'd probably need our own inline function to keep the playing
field level.  Some tweaked algorithms[1] are also said to speed up
small integer tables, Unicode tables etc.
How about add a pg_bsearch() and #define bsearch(a,b,c,d,e) pg_bsearch(a,b,c,d,e) to use it?

--
Regards,
ChangAo Chen

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