Weight certainly came into it with the BR boys.
As to barrel length and velocity, the short barrels, with very small powder charges can give higher speeds than the same load in a longer barrel. I guess what this means, is that to be efficient, the longer barrel needs more powder.
Check the .58 cal results in Lyman's book. The 24" barrel gave higher velocity with heavier changes than did the 32" barrel, yet with smaller charges, the longer barrel gave slightly higher speeds - usually up to aound 50fps. Not at all you wouldexpect.
Instead of the piddly 1,077fps they achieved in the 24" barrel with 70gr. 2F GOX, my 24" bl'd Musketoon delivers 1,340fps with 70gr. 2f GOEX using virtaully an identical ball and patch.
It's interesting that in some calibres, their figures are very close with today's powders, yet as in the .58's, they are way out of line. Even in 1978, I recorded over 200fps higher velocities in my Hawken than they achieved in their Zouave barrel, yet I used a larger, heavier ball. They recorded 1,506fps with 140gr.2f GOX using a .562", 260gr. ball and .015" patch which ran .006" larger than groove diameter, whereas I got 1,683fps with spit and 1,736fps with bear grease, using a .575", 275gr. ball ball and .022" patch. My combo was a bit tighter as .015 larger than the groove diameter.
Tests should be done over a range of powders in one's own rifle, to find out what's efficient and what shoots well. A cheap chronograph, like the Lee products is more than capable of showing what's going on. Guesstimations don't work well and can present the wrong conclusions.
Regarding barrels so long as to retard velocity, I am not convinced you will see that, except perhaps with an exceptionally weak charge that spits the ball out the muzzle, ie: 10gr. powder in a .45 or 50 with a 40" bl. In this case, a 20" barrel might be faster, making the 40" bl. slower - but only with that sort of a load no one uses.