It has to be balanced.
Longer barrel = higher fps to a point, then it reduces it, but more importantly FPS is easy, It's a spring and it can be changed without any issues.
Longer barrel also = more variance in shot to shot FPS. This is bad for a sniper rifle. You need every shot to be the same or as close as possible. Having +-5fps a shot isn't going to cut it because with that FPS difference you will also see a hop variance. So the shot you fire will not hit the same point every time predictably.
You need to do a true volume calculation, then factor the barrel length to that. There are countless threads on this on here and on the sniper forums. Everyone has a different answer but most will be saying you need to be heading out towards the 2.5-3:1 ratio to get the shot consistency you need.