This subject is wide open for a lot of discussion. So time for my two-cents-worth experience:
When I first started shooting, I was a long barrel fanatic. My first three guns had a 6", 8 3/8", and 8 3/8" barrels respectively. I thought short barrels "wasted" energy, to describe as briefly as possible.
I recently got a chronograph and proceeded to test a whole bunch of 38 and 357 rounds of all weights and power combinations.
My 357's are 3", 4", 6", & 8 3/8". So I got to shoot all this ammo through 4 different barrel lengths - one right after the other. I had so many different rounds, this took 2 days out at the range. It was an arduous process (well, as "arduous" as shooting a gun gets ;-)
To generalize my findings: Basically, after 4", most rounds do not see a significant velocity increase; in fact, many decreased through the longer barrels (target loads mostly). Only the hottest loads, with the slowest powders, with the heaviest bullets showed significant velocity gains.
I wouldn't have guessed that. Good learning experience. "Ballistics by the Inch" is a good informational site. I've been there. But I don't think it necessarily tells the full story. On thing that my findings taught me - and admittedly, there's some speculation here - is that the cylinder/barrel gap in revolvers plays quite a role. I think if there were no gap there for gasses to escape, my finding would have been a lot different. I don't think Ballistics by the Inch data accounts for that gap.
Also, I would suspect that things are a little bit different with the big-bore guns. If I had to guess, there probably is a barrel length were returns diminish, but it's probably something a bit longer than 4" - maybe 8 or more. But at some point, that pesky cylinder/barrel gap will come into play.