Citing PETSc' install instructions:
Configure defaults to building PETSc in debug mode. One can switch to using optimzed mode with the toggle option --with-debugging [defaults to debug enabled]. Additionally one can specify more suitable optimization flags with the options COPTFLAGS, FOPTFLAGS, CXXOPTFLAGS. ./configure --with-cc=gcc --with-fc=gfortran --with-debugging=0 COPTFLAGS='-O3 -march=p4 -mtune=p4' FOPTFLAGS='-O3 -qarch=p4 -qtune=p4'