One of the main challenges of the measures against the COVID-19 epidemic is to reduce the amplitude of the epidemic peak without increasing without control its timescale. We investigate this problem using the SIR model for the epidemic dynamics, for which reduction of the epidemic peak IP can be achieved only at the price of increasing the time tP of its occurrence and its entire time-span tE . By means of a time reparametrization we linearize the equations for the SIR dynamics. This allows us to solve exactly the dynamics in the time domain and to derive the scaling behaviour of the size, the timescale and the speed of the epidemics, by reducing the infection rate alpha and by increasing the removal rate beta by a factor of lambda. We show that for a given value of the size (IP , the total, IE and average I ^ P number of infected), its occurrence time tP and entire time-span tE can be reduced by a factor 1/lambda if the reduction of I is achieved by increasing the removal rate instead of reducing the infection rate. Thus, epidemic containment measures based on tracing, early detection followed by prompt isolation of infected individuals are more efficient than those based on social distancing. We apply our results to the COVID-19 epidemic in Northern Italy. We show that the peak time tP and the entire time span tE could have been reduced by a factor 0.9 </= 1/lambda </= 0.34 with containment measures focused on increasing beta instead of reducing alpha.