Do you know what you are measuring with pgbench?

pgbench flamegraph
pgio flamegraphs
perf record --call-graph dwarf -F99 -e cpu-cycles -a
./configure CFLAGS=" -fno-omit-frame-pointer" --enable-debug

pgbench

pgbench --initialize --scale=8 pgio
pgbench --no-vacuum --select-only --protocol=prepared --client=12 --jobs=12 --time=120 pgio &
sudo perf record --call-graph dwarf -F99 -e cpu-cycles -a \
-o /tmp/perf.data sleep 60
sudo perf script -i /tmp/perf.data | ./stackcollapse-perf.pl | ./flamegraph.pl --width=1200 --hash --cp
pgbench.svg

pgio

UPDATE_PCT=0
RUN_TIME=60
NUM_SCHEMAS=1
NUM_THREADS=12
WORK_UNIT=255
UPDATE_WORK_UNIT=8
SCALE=100M
DBNAME=pgio
CONNECT_STRING=pgio
CREATE_BASE_TABLE=TRUE
sh ./setup.sh
sh ./runit.sh &
sudo perf record --call-graph dwarf -F99 -e cpu-cycles -a \
-o /tmp/perf.data sleep 60
sudo perf script -i /tmp/perf.data | ./stackcollapse-perf.pl | ./flamegraph.pl --width=1200 --hash --cp > /tmp/perf.svg
pgio.svg

In summary…

Update 05-JUL-2019

Update 21-SEP-2019

Developer Advocate at Yugabyte, Open Source distributed SQL database 🚀 Also Oracle ACE Director, Oracle Certified Master, AWS Data Hero, OakTable member