It depends on the edition. In past editions ab optimized character could be orders of magnitude beyond an unoptimized character, superman vrs Starbucks barista levels of disparity in some cases. In 5e however there is so little room for optimization that it pretty much amounts to an archer taking sharp shooter instead of actor... yea it makes a difference, but the default game math crunch assumes no feats & no magic items as a baseline so literally anything is optimized once you use those two things if they impact your party role in any way