Why Python is slow and can fast in the future what do think? | Sololearn: Learn to code for FREE!

+3

Why Python is slow and can fast in the future what do think?

10/18/2021 7:19:45 PM

Asghar Abbasi

23 Answers

New Answer

0

Python is a higher level language than C, which means it abstracts the details of the computer from you - memory management, pointers, etc, and allows you to write programs in a way which is closer to how humans think. It is true that C code usually runs 10 to 100 times faster than Python code if you measure only the execution time. However if you also include the development time Python often beats C.Other interpreted languages such as Java bytecode and .NET bytecode run faster than Python because the standard distributions include a JIT compiler that compiles bytecode to native code at runtime. https://stackoverflow.com/questions/3033329/why-are-python-programs-often-slower-than-the-equivalent-program-written-in-c-

+12

Python is an interpreted language. It will never be as fast as a compiled language. That's why a number of modules are nothing more than wrappers around C/C++ code. For computationally intensive operations it is possible to mix Python with native code. https://docs.python.org/3/extending/extending.html https://realpython.com/python-bindings-overview/ This gives you the convenience of Python with the speed of C/C++ where needed.

+12

I dont know about you all, but this question: "Why Python is slow and can fast in the future what do think?" I look at it, then read it, then read between the lines, then read backwards, upside down, ... but I still cant make sense of what it is asking. Especially the part where it goes "and can fast in future what do think?" So I wonder, How did you all come up with these debate argumentals? Was the question clear and I am the only one not getting it? Maybe my brain needs some higher level of language to get started.

+10

Bot, being popular with script kiddies and students who know no better is not the same thing as being used for production grade commercial products. The talentopia article is using the Tiobe index as its metric for claiming Python has surpassed Java. Indeed the Tiobe index has Python ranked as the No.1 language at the moment. However, what does that actually mean? "The TIOBE Programming Community index is an indicator of the popularity of programming languages. The index is updated once a month. The ratings are based on the number of skilled engineers world-wide, courses and third party vendors. Popular search engines such as Google, Bing, Yahoo!, Wikipedia, Amazon, YouTube and Baidu are used to calculate the ratings. It is important to note that the TIOBE index is not about the best programming language or the language in which most lines of code have been written." https://www.tiobe.com/tiobe-index/ Obviously with Billions of script kiddies worldwide making searches for Python this is going to skew the statistics. Just look at the number of Python questions on Sololearn regarding Python. Yet most of those questions are trivial or duplicates. Let's address another claim in that article... "Python is mostly used for web development,..." According to w3techs... https://w3techs.com/technologies/overview/programming_language Python only has a 1.4% of market share in server side programming languages; PHP is at #1 with 78.5%; Java is #4 (3.7%); JavaScript #6 (1.6%). That's JavaScript on a server i.e. node.js. JavaScript in the browser accounts for 97.6%. Even static web pages exceed Python at #7 (1.5%). w3tech automatically analyze over 10 million websites to generate their stats. So it's important to know how statistics are gathered before blindly accepting them. Statistically, everyone that breathes air dies. That's a 100% mortality rate, so the conclusion is that air is toxic.

+8

Arun Jamson. Python is not a higher level language than C. Both C and Python are high level languages. Just because a language has pointers and memory management features does not make it a low level language. Just because a language has a bigger library does not make it a higher level language. Your argument that development time is more important than runtime is flawed. If code is too slow it's not acceptable. In commercial software development code maintenance is more costly than the initial development cost. Python is not a new language. It's over 30 years old. In fact it's older than Java, JavaScript and C# but has failed to make the market penetration of any of those languages. There's a reason for that. Python is not a robust language, it doesn't scale well. The reason it doesn't scale well is because it lacks type safety. You will notice that most of the languages used to develop commercial software have two things in common. Firstly they are all compiled languages. Secondly they all have type safety. The only widely used language that is not compiled is JavaScript, which also lacks type safety and why there is a move towards TypeScript. I don't understand why zoomers suddenly think Python is some kind of miracle cure. It hasn't proven itself in the past 30 years. Fanaticism seems to be a zoomer trait. There can be only one! There are no other choices allowed. Elon musk is a God, Hyperloop is the future of travel; Teslas are the bestest cars and we're all going to drive them on solar freakin roadways. Heretics will be banned from all forms of communication. One people, one nation, one world, one Reich! I find it quite disturbing.

+5

Martin Taylor ok bro fixed it.

+5

【ACE】 I am not judging anyone's english skills. Just stating that I dont understand anything in there. It s complete garbage of a question to understand. I am the type of person that doesnt assume much out of unclear statements. The word "assume" can be decorticated into three other words: - "ass" - "u" - "me" Assuming then simply makes an ass out of you and me. So one should never assume, one should be certain.

+4

Arsenic ok bro and I didn't claim i thought of helping only anyway thanks for correcting me 😊.

+4

Arun Jamson, you may not have claimed that your response was your own but neither did you give credit, and you still haven't. The lack of an accreditation to your post implies that it is your own. The norm is that a post is assumed to belong to the person posting it if no reference is given; otherwise every post would require a notice that the work was an original work.

+4

ChillPill I don't get it either. But I always tend to find some kind of debate/argument when I read "python", "slow" and "fast" all in same line.

+3

Arun Jamson it's much better to directly share the external link rather than copy pasting the answer ( which is incomplete btw ) from SO and claiming them to be your own. https://stackoverflow.com/a/3033379/12030775

+3

Bot I am interested to know what matric are you using here to back up the fact that Python surpassed Java ?

+3

Martin Taylor you killed me! :P

+3

ChillPill his question isnt that hard to understand. English probably isnt his first language, but we can still pretty much figure out what he is trying to say. So lets not act like compilers shall we?

+2

Martin Taylor, I think Arun Jamson meant that python is more abstract than C, most of the workload (memory management, sanity checks) are all handled internally in python which is not the case in C.

+1

https://www.talentopia.com/python/python-surpasses-java-and-becomes-the-second-most-popular it might have changed in 2021 though

+1

+1

Python is interpretrt

+1

https://www.infoworld.com/article/3385127/what-is-pypy-faster-python-without-pain.html

+1

Coz python is an interpreted language so its slow as compared to other languages.