The newer versions don't tend to run great and that may not be fixable without better hardware, but personally I have found that running Sodium (a Fabric mod) along with Phosphor and Lithium gave me a better framerate than vanilla or Optifine.
(In a fresh vanilla-generated world, I was getting 30-35 frames with both vanilla and Optifine, and 50-60 with sodium/phosphor.)