which is better in i3 4th generation or i5 3rd generation

Vitric9

Distinguished
In most cases the Ivy Bridge i5(3rd Gen) will out perform a Haswell i3(4thgen) Here is a simple site to compare some synthetics benchmarks and specs I included the i5 3570k wihch is popular and the i3 4330 which is the fastest i3 i think.....:http://www.cpu-world.com/Compare/493/Intel_Core_i3_i3-4330_vs_Intel_Core_i5_i5-3570K.html
Note: the haswell i3 is great in single threaded applications and pretty good and multi threaded but a 4 core ivy bridge will have better performance using all 4 cores
 
As others have said, i5 3rd gen is stronger than i3 4th gen.

Of course, an i3 4th gen CPU will allow you to get a motherboard that'll last longer before going obsolete.
 

Vitric9

Distinguished
If your are buying a new CPU then you could save a bit of coin if you do not think you will be using heavily multi-threaded work loads by going with the i3 4130 or 4330 they are pretty cheap compared to a most Ivy Bridge i5s though some might be only about $50 less than an i5. If your are not a power user and like fast and responsive browsing and steaming media as well as light gaming, an i3 4330 is an excellent choice. Though i am quite sure it can handle most new games quite well with the right graphics card. As for the latter a i5 3570K is great for a power user and depending on how close you are to a microcenter you may find one pretty cheap.