model-writtenrun 7672 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Andres Freund reported that early pgbench connections could monopolize ProcArrayLock and prevent later connections from joining a benchmark, then supplied an inline barrier prototype demonstrating misleading throughput and delayed progress reports #1 #2.
- Kyotaro Horiguchi favored enabling synchronization by default and reporting connection time separately, while Fabien COELHO argued that an available barrier should be unconditional; Andres explained why simply running longer benchmarks would not solve his comparison problem #3 #5 #6.
- Fabien's first attached implementation added startup and connection barriers, revised throughput accounting and consolidated timing around integer microseconds #7.
- Andres's review led Fabien to reuse one barrier, introduce inline timing helpers, clarify duration names, print the pgbench version and simplify thread creation and result collection #8 #10.
- Following Andres's suggestion to use nonblocking connection establishment, Fabien posted a separate asynchronous-connection experiment and reported slightly worse local-socket performance; that experiment received no later revision or landing in this thread #6 #11.
- Fabien split the main work into timing and barrier patches, keeping reconnection costs in throughput under --connect while reporting initial connection time separately for ordinary runs; he also floated future synchronization across multiple pgbench processes #12.
- After a quiet interval, Daniel Gustafsson requested a rebase and filenames matching application order, which Fabien supplied #13 #14.
- Hayato Kuroda found that a failed connection could leave other threads blocked forever, supplied a barrier-before-cleanup fix and requested documentation corrections, all incorporated into Fabien's next full series #15 #16 #17.
- Hayato checked the fixes, while Fabien retained a comment questioning whether partially failed benchmarks should produce performance results and defended unconditional synchronization over compatibility with misleading old results #18 #19 #20.
- Marina Polyakova identified Windows API-version requirements, prompting Fabien to comment out DeleteSynchronizationBarrier() rather than raise the platform requirement for pgbench #23 #24.
- Alexander Korotkov proposed fairer lightweight locks as an alternative, but Marina's experiment still showed unstable initial progress and Andres explained that connection startup skew exists independently of lock fairness #25 #26 #27 #28.
- Thomas Munro discovered that macOS lacked pthread barriers and added a mutex/condition-variable implementation, then cleaned up initialization, destruction and MSVC configuration while keeping Windows emulation inside pgbench #30 #32 #34 #35.
- Fabien proposed moving all thread emulation into src/port, but Thomas preferred supplying only missing POSIX facilities there and keeping pgbench's limited Windows abstraction local #36 #37.
- Thomas produced a four-patch series with a separate THREAD_* macro refactoring, then corrected Windows thread creation and incorporated David Rowley's tested correction to the barrier macro #38 #39 #40.
- Thomas committed the portability prerequisite and thread abstraction from #40 with light cleanup as 44bf3d5083 and b1d6a8f868, announcing the landing in #41.
- The same landing took Fabien's timing changes from #40 with formatting and output-wording edits as 547f04e734, and the synchronization member with additional initialization error reporting as aeb57af8e6 #41.
- Tom Lane reported that the new barrier emulation broke an ancient HP-UX build despite --disable-thread-safety, and suggested making both configure probes conditional; Thomas posted the fix after testing enabled and disabled configurations on macOS #42 #44 #45.
- Thomas committed that fix unchanged as de91c3b976, after which Tom reported successful compilation and make check on the affected machine, although its pgbench tests had not yet run #47 #48.
- Fabien remained unhappy with the macro-based thread interface, but accepted Thomas's explanation of Windows thread support; a cleaner common thread abstraction remained a future possibility rather than additional work submitted here #49 #50 #51.
- The main series and build fix were landed when Dave Cramer revived the thread in 2023 with a pooler performance question; his measurements showed faster query execution with pooling, but Fabien's final question about prepared statements left the cause unresolved and introduced no new patch #52 #53 #54.