Core i5 8th gen has 6 cores and 6 threads. Core i7 4th gen has 4 cores and 8 threads. The 8th gen consumes a lot less power and runs much cooler, so you can use a cheaper heatsink as well. For gaming performance the difference is small. If you are looking at building one, I would get the newer setup if they are around the same price, especially because if you decide to upgrade your CPU later to something like an i7 9700K you can just put a new chip in.