The chosen file format, or “container”, has hardly any effect on file size or quality (MP4, MKV, AVI). So based on personal experience (note that I’m not an expert) a few pointers:
The times that encoding a movie from DVD took 8 hours are long gone, most of my computers can convert a DVD easily under 15 minutes. The time to encode a movie should be irrelevant – sometimes the time difference is really not worth it, for a few minutes extra you will get a better quality and/or smaller file size. Personally I believe that fine tuning should be a balance between file size and quality.
Optimizing or fine tuning of video encoders comes basically down to: