Your M3 is faster if driven perfectly. His 335is has more torque and will outsquirt you at times. With a $500 tune, his 335is will be as fast as or faster than your M3. With a tune, intercooler, downpipes and exhaust, his 335is will leave your M3 behind almost all the time if not all the time.
I went through all this recently when car shopping. I would not have bought the 335is, but rather a used 335i. The 3.0L twin turbo has awesome torque and is easily modded. However, I have a 500 rwhp E36 M3 and spend my mod energy on that car and wanted a comfortable and modern and fast and excellent handling daily driver with a CPO warranty that I could leave alone and the E90 M3 fits that bill. With the 335i, I would have wanted a $2500 set of coilovers, a $500 set of roll bars, a $1500 limited slip, a $500 tune, a $1000 intercooler, a $500 intake, a $1000 set of downpipes, a $2000 exhaust, a $2000 wheel and tire package, a $2000 brake upgrade, and a $3500 turbo upgrade. After all that, it would have easily beaten the E90 M3 in a straightline and equaled it around a track. But I would have been tired and the warranty would be void.