The AMD Ryzen 7 2700X wins in 8 out of 14 comparable specs, with 2 ties. Its biggest advantage is L2 Cache (167% better).
Core i5-10600K wins in 4 specs (Max Memory: 100% better).
Recommendation
Choose Ryzen 7 2700X if you want the best overall performance — especially l2 cache.
Choose Core i5-10600K if max memory matters more to you.