The circuit breaker size is only loosely associated with the load. The wire size for a motor load starting a compressor could be heavier than a #10 for a 30 amp circuit. #10 might be fine for a dryer but you might need #8 or possibly #6 depending on the distance and the load, ie if the compressor starts hard.
A good rule of thumb is to take 125% of the running amps then look at what circuit breakers would be suitable, at 80%. So, a 20 amp compressor would be 25 amps for calculation sake and a 30 amp breaker would be 24 amps so a 40 amp breaker with a minimum of #8 would be used.
