For general applications I doubt you'll notice any difference without a stopwatch to time actions.
For gaming at 1080 rez with a high refresh ( 120Hz or above ) display the i4 8400 is a fairly clear winner, although the margins vary it usually comes out on top.
Game at 2K and you'll need to run benchmarks to spot any difference and 4K will be GPU limited regardless of CPU/RAM.
Build with comparable motherboards and RAM and the R 5 2600 just aces the i5 8400 for price, but not by much.
So, Neo, will you take the Blue pill or the Red?