That is a little difficult to answer but I will say that it is better to have a moist compost pile in the sun.
I always had my compost pile where it was fairly easy to get the water on it.
If you garden where there is an abundance of rainfall during the growing season (what's that like ?), maybe you'd want the compost under cover so it doesn't get too wet. If you live somewhere that may not see 5" of rain thru the entire growing season don't be like one of my neighbors:
He set his compostables up in a wire bin above the ground in a dry area behind his house. I don't know if that bin ever got any water that didn't fall out of the sky. What was in it was petrified after a few years! I looked at it for what must have been 5 or 10 years without seeing any change! Finally, a leg collapsed and the bin fell down - where, I suppose, everything finally rotted there amongst the weeds.
In the sun, although it will still eventually compost in the shade too. That couple extra degrees and considering that compost is dark colored and holds solar heat gives you an extra advantage. As Steve said, very important to keep it moist. What goes into your compost pile will also affect how quickly it works, gotta have greens and browns in there (I'll have to look up the ratio). Everything will eventually rot and break down, so I don't get too particular about mine because I am patient (and I keep two piles--one ready to use and one I'm working on.) But if you see it steaming, you know you're really cookin'! Best combo I've seen to break down quickly was horse manure and spent hay that my dad piled up with the tractor. It was HOT!