The link jmr40 posted is informative, but look it over carefully. The test barrels they used did not have a cylinder gap, and elsewhere on that website, they discuss how guns that do have a cylinder may gain less from a longer barrel, because the longer the bullet is in the barrel, the more gas and pressure exit out the cylinder gap.
If you compare actual guns toward the bottom of the link, you'll see that a 4" S&W often produced higher velocities than a 5" S&W, which often produced higher velocities than a Colt with a 6" barrel.