In normal 6.08 barrels the BB stabilizes after let's say 25cm. The hopup gives it a push and it bounces a few times before stabilizing in the barrel and sitting onto an air cushion. You can see the marks it leaves if you use BBs that leave a mark. Tighter bores stabilize the BB somewhat earlier.
So it depends on this bouncing but after that 25cm length doesn't matter.
But. Barrel length does matter in regards of the useful size of the cylinder. The cylinder size, barrel length and BB weight has to be matched. Switching to a long barrel and leaving everything else as is, will make the gun worse.
The most accurate out of box gun I ever had was a Boyi G36c. That one has a barrel about 240mm.
Also one of the least effective and most costly upgrade is precision barrel.
To get accuracy: clean everything, use good and heavy BBs, use good hopup nub, use good hopup bucking, stabilize fps, and just after all these, get a precision barrel.