Skip to content

Commit efe2382

Browse files
committed
pgbench: Avoid unnecessary measurement of connection delays.
Commit 547f04e changed pgbench so that it used the measurement result of connection delays in its benchmark report only when -C/--connect option is specified. But previously those delays were unnecessarily measured even when that option is not specified. Which was a waste of cycles. This commit improves pgbench so that it avoids such unnecessary measurement. Back-patch to v14 where commit 547f04e first appeared. Author: Yugo Nagata Reviewed-by: Fabien COELHO, Asif Rehman, Fujii Masao Discussion: https://postgr.es/m/20210614151155.a393bc7d8fed183e38c9f52a@sraoss.co.jp
1 parent 7af5c38 commit efe2382

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/bin/pgbench/pgbench.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6622,6 +6622,7 @@ threadRun(void *arg)
66226622

66236623
thread_start = pg_time_now();
66246624
thread->started_time = thread_start;
6625+
thread->conn_duration = 0;
66256626
last_report = thread_start;
66266627
next_report = last_report + (int64) 1000000 * progress;
66276628

@@ -6645,14 +6646,6 @@ threadRun(void *arg)
66456646
goto done;
66466647
}
66476648
}
6648-
6649-
/* compute connection delay */
6650-
thread->conn_duration = pg_time_now() - thread->started_time;
6651-
}
6652-
else
6653-
{
6654-
/* no connection delay to record */
6655-
thread->conn_duration = 0;
66566649
}
66576650

66586651
/* GO */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy