The cache matters a lot. That’s basically why the x3d chips are so great at gaming. With over clocking you’ll always get a lower clock than the stock boost clock with these newer chips. That’s why PBO (precision boost overdrive) in combination with CO (curve optimiser) will give the most performance. Both chips can do this.
Tl;Dr: get the x3d.
I’d go for the 7800x3d if gaming is your priority. If you need the cores the 7950x would be the economical option.