aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2021-08-30 21:35:24 +0900
committerFujii Masao <fujii@postgresql.org>2021-08-30 21:37:43 +0900
commitefe2382d5ade2c8d63f2aa1b48cc85691a2bfabd (patch)
tree5c5bd71e6ba8f136d51fb968d419e513bb62cb5e
parent7af5c38eb9da5b0ae72c1dd3d847f43cd39d1f5a (diff)
downloadpostgresql-efe2382d5ade2c8d63f2aa1b48cc85691a2bfabd.tar.gz
postgresql-efe2382d5ade2c8d63f2aa1b48cc85691a2bfabd.zip
pgbench: Avoid unnecessary measurement of connection delays.
Commit 547f04e734 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 547f04e734 first appeared. Author: Yugo Nagata Reviewed-by: Fabien COELHO, Asif Rehman, Fujii Masao Discussion: https://postgr.es/m/20210614151155.a393bc7d8fed183e38c9f52a@sraoss.co.jp
-rw-r--r--src/bin/pgbench/pgbench.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index 129cf2ed61d..a3843c2de4c 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -6622,6 +6622,7 @@ threadRun(void *arg)
thread_start = pg_time_now();
thread->started_time = thread_start;
+ thread->conn_duration = 0;
last_report = thread_start;
next_report = last_report + (int64) 1000000 * progress;
@@ -6645,14 +6646,6 @@ threadRun(void *arg)
goto done;
}
}
-
- /* compute connection delay */
- thread->conn_duration = pg_time_now() - thread->started_time;
- }
- else
- {
- /* no connection delay to record */
- thread->conn_duration = 0;
}
/* GO */