In case of a newish saw, I use the calculation every 10cm (about 4 inches) per HP.
Give or take a little. Considering you actually use the whole bar.
Some people don't like the bend over and would use a 40" bar like a Bushcutter.
If you use a much longer bar, you'll likely wear out your clutch, or make your piston get hotter than optimal.
But most importantly, the saws oiler is not made to oil such a bar. Sparky bar and heavy chain wear bla bla bla.
If the bar is shorter, you are carrying needless extra weight, and be using more gas.