As a rule longer barrels are more accurate than shorter ones on the same model gun. Trigger Action Trigger action is probably the most important part of the equation. Many pistols with mediocre triggers as they come from the factory can be made fabulous by an inexpensive trigger job. Sights Quality micrometer sights with positive click stops are essential. In addition, sight radius, the distance between the front and rear sights, is a factor in barrel selection.
Some shooters score better with a shorter sight radius.
Here is where personal preference is a factor. Some shooters feel that a barrel heavy gun helps them recover after recoil in rapid fire. Likewise, some can hold an overall heavier gun much steadier that one that is lighter. But many prefer just the opposite, gaining better control and less fatigue with the lighter gun that balances back into the hand. The connection between you and your pistol is critical.