This question has been studied extensively. Just Google "barrel length velocity" and you'll find lots of interesting data rather than guesses and rules of thumb. Generally, velocity plateaus around 24-27 inches of barrel length. Beyond that, velocity may actually decrease. This is because peak pressure occurs within the first few inches of the barrel and then starts to fall. When the pressure behind the bullet generates less force than the friction between the bullet and the barrel, the velocity decreases.