I have seen many debates on this site which compare C++ to Python however I wanted to try to spin the question a little. Are there any processes where the two are equal in performance?
I am writing a small application that makes a socket connection, reads the incoming messages (about 5000 per second) does some parsing on each line and then logs the data to a text file. I had a developer build a C++ program to do this and it works quite well. However, I'd like to expand upon the original idea myself, without said developer. I have tried learning C++ and it just feels over my head. I have tried learning python and it feels "right" to me. My question is, for all the articles that boast C++ performance over Python, is it possible that, based on my particular needs that I just described, Python would do the job just as fine as C++.
On a separate note, I have looked into golang and it looks like an interesting middle ground. Compiled language with easier syntax to pick up. Would this be an alternative?
Thanks.
Python is, in general, definitively slower than C++, but it's not as slow as most people think at first - there have been a number of optimizations over the years, and there are also tricks you can do. There are some resources out there that can help you squeeze that extra speed out of Python, and really try to get it to be as fast as possible.
In the end, the only real way to find out if you can get acceptable speed by comparison is to actually make the program you speak of, and test it. Find a good code profiler for each language and compare their results to see exactly how well each does relative to each other.