How can I determine what's a better configuration for my app?
The correct configuration depends on your hardware, your database size and your workload, none of which we know.
Tune conservatively at first, setting shared_buffers and work_mem to some reasonable values based on database size and workload, and setting maintenance_work_mem, effective_cache_size, effective_io_concurrency and random_page_cost according to your hardware. Finally,  configure logging.
Adjust these and other parameters based on the findings from a realistic load test.