Most shooters think that the longer the rifle barrel, the more accurate the rifle is and the better ballistic performance in terms of bullet energy and velocity. Sometimes this is true, but today it is no longer a given that a long(er) barrel is optimal in any rifle platform.
Studies have been done which begin with a rifle sporting a 26-inch barrel. It was fired to measure the bullet velocity, then successive barrel cuts removed one-inch at a time, again firing the barrel to measure the velocity at each increment. The barrel was eventually cut back to 20 inches, and each time an inch was lopped off the barrel the velocity dropped about 50 feet per second (FPS).
So, in theory if the 26-inch barrel produced a velocity of say 2900 fps (a 30-06 with 150 grain bullet), the velocity of the resulting 20-inch barrel would be reduced by 300 FPS to 2600 FPS.
It is up to you to decide whether a loss of 300 FPS is outweighs the handiness and weight-savings of a rifle with a 20-inch barrel. That is the tradeoff.
Is a longer barrel inherently more accurate? I don’t think so. Modern barrel steels and manufacturing processes are producing unprecedented accuracy in rifles regardless of barrel length. If you are a dyed-in-the-wool competitive target shooter it might matter, but for practical field accuracy when hunting, I do not think it is that critical. Many other factors contribute to shooting accuracy in the woods.
Now, do these thoughts apply regardless of the rifle type? Bolt action vs an AR semi-auto, for instance? Though the mechanical systems operate differently, at the moment the gun is fired, the velocities are roughly the same if barrel length, cartridge, load etc are all equal.
In the final analysis, it is more important to focus on good shooting skills than to worry about the barrel length. What velocity you lose by a shorter barrel is not that critical.