I'm coming from a nicely modded 135i (JB3 map7, DCI, Downpipes, KW v2 coilovers, etc... pushed close to 390rwp on 93octane) and I've tracked the car several times; it's a great fun car.
The M3 is not as fast in a straight line as a nicely modded N54 variant, but it's close enough. Take it to the twisties and on the track, and the story changes completely! The handling and transmission, the balance of suspension and the M diff in conjunction with the beautiful delivery of the power from the engine, is not gonna be matched by the 335 no matter how much you dump on it with bolt ons.
Both are great cars for what they were intended to do.
e90 M3, Interlagos Blue / M individual two-tone, ZCP, ZP2, ZCV, DCT, ED.