Back in the old days, say, 16/1700's It was found that a black powder cannon would cease to gain velocity after 7' of barrel, no matter what diameter. Many Shipboard cannon had thier barrels cut off to save weight and help the ship to manuver faster.
I would guess that you're gonna find that the length is entirely dependant upon the propellant. If you shoot a Swift with 3031 it's gonna run out of usefullness for more barrel length a lot earlier than a 300RUM using R25. The same 300RUM simply cannot use 3031 because of the speed at which pressure is made. However, you can test for yourself with the swift or 223 if you have one handy. Go try magnum primers with R22/25 H1000 or H4831 in a 22 with 55gr bullets. You will see that the real slow powders will stop making velocity no matter how much you put in because your 22 has a real short barrel and the bullet is gone in 60% of the time a 30cal bullet would be in the same length barrel. Now, don't go loading your RUM with H380 to find out how that works or we'll be reading about you as a statistic. You won't blow up a 22 with a light bullet with slow powder but a big gun with fast powder is a very bad idea.
Some of the powders like R25 and H1000 never really do burn completely. They are so slow, they are nearly not flamable. You can dump H1000 on the sidewalk and throw a match on it and it won't light on fire. It will continue to make additional pressure in a VERY long barrel, but won't make much initial pressure. (A good thing in a big magnum) Pressure is what makes powder burn, and, if the pressure becomes very high, the powder burns faster. A catch 22 deal. That's why a certain powder like say 4895 will be finicky in a magnum about how much can be loaded. as you go up in charge, all of the sudden, it ALL burns immediately and the pressure curve rises very sharply for a small increase in powder.
The high and low of it, it depends on the powder. You can test with any gun you own how it works.