Performance differences between Python and C

后端 未结 14 1115
闹比i
闹比i 2020-12-31 08:02

Working on different projects I have the choice of selecting different programming languages, as long as the task is done.

I was wondering what the real difference is

相关标签:
14条回答
  • 2020-12-31 08:41

    Actually you can solve most of your tasks efficiently with python.

    You just should know which tools to use. For text processing there is brilliant package from Egenix guys - http://www.egenix.com/products/python/mxBase/mxTextTools/. I was able to create very efficient parsers with it in python, since all the heavy lifting is done by native code.

    Same approach goes for any other problem - if you have performance problems, get a C/C++ library with Python interface which implements whatever bottleneck you got efficiently.

    0 讨论(0)
  • 2020-12-31 08:41

    C is definitely faster than Python because Python is written in C. C is middle level language and hence faster but there not much a great difference between C & Python regarding executable time it takes. but it is really very easy to write code in Python than C and it take much shorter time to write code and learn Python than C. Because its easy to write its easy to test also.

    0 讨论(0)
提交回复
热议问题