While a close-reach or beam-reach is going to give the vessel the highest speed through the water, this may not be what you want. Being close-hauled will point you higher so while you lose speed, the end result may still be faster to your destination, or more appropriate through narrows, or in order to use a tide or any one of a number of other reasons.
This diagram from the RYA points of sail page shows this quite clearly:
However, as you have indicated, it may not be the ideal course upwind - for example if the sea is choppy a close hauled course may mean every wave halts the boat. Your close reach may be better so you can flow over the waves. You will be a couple of points lower off the wind, so will need to tack more, but if your speed across the water makes up for this then that may be the way to go.
This varies a lot with the type of boat. Monohulls point much higher than catamarans, but catamarans are still faster over most courses simply because of the much high speed across water. Square riggers cannot point very high at all - in fact they are so bad at it, they used to choose routes specifically to avoid it.