Comparing the Core i5-6400 to its competitor, the FX-8350, we can say we have a technical tie on performance. On some tests the Intel CPU was faster, and on other ones the AMD model performed better. So, we can say both processors are goog choices for mainstream computers, for gaming or work.
However, comparing the performance of the Core i5-6400 to the Core i3-6100, which is a lower-end model and, thus, less expensive, things change a little.
When we tested the FX-6350, one of the conclusions we achieved was that it has a better cost/benefit ratio that the higher end model, the FX-8350. Regarding to the Intel CPUs, the conclusion is pretty much the same: on several games and programs, the Core i5-6400 is not faster than the Core i3-6100, which costs two thirds of its price.
It happens due to the higher clock used by the Core i3-6100 (3.7 GHz) compared to the Core i5-6400 (from 2.7 GHz to 3.3 GHz, typically 3.1 GHz at full load.) This clock difference is big enough to compensate the advantage of the four real cores of the Core i5.
Compared to the FX-8350, the Core i5-6400 performs similarly, but has the advantage of the significantly lower power consumption. On the other hand, the AMD model is a little less expensive, and has an unlocked multiplier.
Concluding, the Core i5-6400 is a good CPU, but it has a poor cost/benefit ratio due to its relatively low clock rate. Probably the Core i5-6500, which has a significantly higher clock (3.2/3.5 GHz) and costs only USD15 more is a better option. And if your priority is keep the low cost, the Core i3-6100 is a more interesting option.