PostgreSQL for running Tests (Durability is not important)
use UNLOGGED tables throughout

set shared_buffers big enough to contain the whole database

if you have bigger queries, increase work_mem

have enough RAM to contain shared_buffers plus work_mem times the number of client connections


Typically, you can gain most by tuning the queries that use most of the time.