If you go to Dan Lilja web site he has all these ariticles for you to read. Good stuff.
TO be honest, in a 338 bore with the case capacity of the Lapua, I would not recommend anything over 34". The reason is that at this length you will only be gaining around 10 to 12 fps per additional inch of barrel.
The disadvantage is that past 34", barrel whip becomes more of a problem and will detract from accuracy.
The 300 RUM would be similar but I would say 36" would be about what I would consider max. The basic same case capacity with the smaller bore will increase fps per inch of barrel length but only to around 15 fps at this length. The added velocity is not worth the decreasing rigidity of the lengthening barrel.
That said, if you used a 2" diameter barrel you could probably reach out 50" pretty easily but ballistically, you would not gain as much as most think.