What effect does a short or long barrel have on velocity?

A long barrel results in a higher velocity, as the propellant pressure is significantly higher than the friction in the barrel. The velocity generally increases by 2-3 m/s per cm.