i'm stress testing 2 different projects: one is proxsmtpd - smtp proxy written in C And the other one, smtp_proxy.py, which i developed under 1 hour, with use of asyncore and smtpd python modules.
I stressed both projects under heavy load, and found out that proxsmtpd is able to hold 400 smtp sessions / sec, while my python program, is able to do only 160 smtp sessions /sec.
So, my question is, does it because there are some performance limitations in asyncore, or C programs are just faster? Or maybe it's me, using asyncore in inefficient way?
I think it's a fair assumption that given a good C version and a good Python version, the C version will be faster and more scalable but in your case, you might want to run a profiler and see why and where your program is not scaling up as much as the C version. Perhaps you can uncover the tight spots and optimise it to squeeze some more performance out of your code. Also, I don't know much about asyncore but the first Python library people seem to gravitate towards when they want to do async stuff is twisted. So, perhaps there is a performance improvement there.