#!/bin/bash dbname=postgres sec=30 for branch in 'pg_allocate_memory_test' 'pg_allocate_memory_test_plus_v5' 'pg_allocate_memory_test_plus_v5_start' do cd ~/pg_src git checkout $branch make clean -s make -j -s make install -s cd ~ pg_ctl stop -D pgdata pg_ctl start -D pgdata -l pg.log sleep 2 for context in 'aset' 'generation' do for chunk in 8 16 32 64 128 256 512 1024 do for alloc_size in 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 1073741824 do echo "select pg_allocate_memory_test($chunk, $alloc_size, 20::bigint*1024*1024*1024, '$context');" > bench.sql echo "Testing pg_allocate_memory_test $branch $context $chunk $alloc_size" pgbench -n -f bench.sql -T $sec $dbname echo "select pg_allocate_memory_test_reset($chunk, $alloc_size, 20::bigint*1024*1024*1024, '$context');" > bench.sql echo "Testing pg_allocate_memory_test_reset $branch $context $chunk $alloc_size" pgbench -n -f bench.sql -T $sec $dbname done done done done