A gun's muzzle velocity is the speed at which the projectile leaves the muzzle of the gun. Muzzle velocities range from subsonic (below 330 m/s / ~1080 ft/s) for some pistols to more than 1,800 m/s (~5910 ft/s) for tank guns firing kinetic energy penetrator ammunition. The latter velocity is close to the limit achievable with chemical propellants. The velocity of a projectile is highest at the muzzle and drops off steadily because of air resistance.
In conventional guns, muzzle velocity is determined by the quality (burn speed, expansion) and quantity of the propellant, the mass of the projectile, and the length of the barrel. A slower burning propellant needs a longer barrel to burn completely, but can on the other hand use a heavier projectile. A faster burning propellant may accelerate a lighter projectile to higher speeds if the same amount of propellant is used. In a gun, the pressure resulting from the combustion process is a limiting factor on projectile velocity. A balance between propellant quality and quantity, projectile mass and barrel length must be found if both safety and optimal performance is to be achieved.
Longer barrels give the propellant force more time to work on propelling the bullet. For this reason longer barrels generally provide higher velocities, everything else being equal. As the bullet moves down the bore, however, the propellant's gas pressure behind it diminishes. Given a long enough barrel, there would eventually be a point at which friction between the bullet and the barrel, and air resistance, would equal the force of the gas pressure behind it, and from that point, the velocity of the bullet would decrease.
Large naval guns will have length to diameter ratios of 38:1 to 50:1. This length ratio maximizes the projectile velocity. There is much interest in modernizing naval weaponry by using electrically driven railguns, which overcome the limitations noted above. With railguns, a constant acceleration is provided along the entire length of the device, greatly increasing the muzzle velocity. There is also a significant advantage in not having to carry explosive propellant and even the projectile internal charges may be eliminated due to the high velocity  the projectile becomes a strictly kinetic weapon.
