Skip to content

Commit bfd4567

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 bad6cef commit bfd4567

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
@@ -6603,6 +6603,7 @@ threadRun(void *arg)
66036603

66046604
thread_start = pg_time_now();
66056605
thread->started_time = thread_start;
6606+
thread->conn_duration = 0;
66066607
last_report = thread_start;
66076608
next_report = last_report + (int64) 1000000 * progress;
66086609

@@ -6626,14 +6627,6 @@ threadRun(void *arg)
66266627
goto done;
66276628
}
66286629
}
6629-
6630-
/* compute connection delay */
6631-
thread->conn_duration = pg_time_now() - thread->started_time;
6632-
}
6633-
else
6634-
{
6635-
/* no connection delay to record */
6636-
thread->conn_duration = 0;
66376630
}
66386631

66396632
/* 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