pgsql: Only clear latch self-pipe/event if there is a pending notificat

Поиск
Список
Период
Сортировка
От Andres Freund
Тема pgsql: Only clear latch self-pipe/event if there is a pending notificat
Дата
Msg-id E1agzUL-0007T0-W0@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Only clear latch self-pipe/event if there is a pending notification.

This avoids a good number of, individually quite fast, system calls in
scenarios with many quick queries. Besides the aesthetic benefit of
seing fewer superflous system calls with strace, it also improves
performance by ~2% measured by pgbench -M prepared -c 96 -j 8 -S (scale
100).

Without having benchmarked it, this patch also adjust the windows code,
as that makes it easier to unify the unix/windows codepaths in a later
patch. There's little reason to diverge in behaviour between the
platforms.

Discussion: CA+TgmoYc1Zm+Szoc_Qbzi92z2c1vRHZmjhfPn5uC=w8bXv6Avg@mail.gmail.com
Reviewed-By: Robert Haas

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c4901a1e03a7730e4471fd1143f1caf79695493d

Modified Files
--------------
src/backend/port/unix_latch.c  | 81 ++++++++++++++++++++++++++++--------------
src/backend/port/win32_latch.c | 19 +++++-----
2 files changed, 65 insertions(+), 35 deletions(-)


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: pgsql: Remove unused, and dangerous, TestLatch() macro.
Следующее
От: Andres Freund
Дата:
Сообщение: pgsql: Error out if waiting on socket readiness without a specified soc