There need to balance on the performance and quality. Some parameters, like number of B frames, num_ref_frames, subblock split, search_x/y, decrease performance and usually increase quality, but it depends on content. Cabac gives better quality and slower performance.
I attached two sample parameter file. One is target for performance. Another is for quality.