+ 2
Why python code runs slowly as compare to other programming languages?
13 Respostas
+ 4
codemonkey python is not compiled to machine code : it is compiled down to python bytecode, that is then interpreted by the python interpreter.
Another reason why Python is slow is that you can modify this bytecode at runtime...
+ 4
It's an interpreted, dynamically typed language.
+ 3
It depends upon your IDE (Itergreted development environment).And more thing,in sololearn app because of a huge number of users of python it works just a little slower.
I hope it will let you understand....
+ 1
Python is slow for some reasons :
- it is interpreted (at least for the CPython implementation, which is the official interpreter)
- python isn't strongly typed (you never explicitly write the types of the variable. And type annotations are simply ignored). That's a big disadvantage because each time you manipulate a variable, python must perform some type checking
- python is an incredibly complex language, that is not designed to be fast anyway
+ 1
SÄñtösh Mà rà vi(Challenge Me On JUMP_LINK__&&__Python__&&__JUMP_LINK) That doesn't mean anything. That is not because a langage seems more complex that it is faster.
In rust :
fn main() {
println!("Hello");
}
And Rust is as fast as c++. And Rust is with c and c++ the three big system programming langages.
Please never judge the complexity of a code to know if it is faster or not. Have you ever heard about zero-cost abstractions? (like iterators in Rust)
+ 1
Granger actually, it doesn't help python, since you can do :
a: int = "hello"
Here, the only things it does is updating the __annotations__ dict.
a: int = "hello"
print(globals())
# you will see :
# "__annotations__" : {"a": <class 'int'>}
But python ignores this annotations. This are simply annotations for the dĂ©velopper, and not for the interpreter đ.
+ 1
Since the python is dynamically typed language, compiler don't have ability to handle dynamic data types that are assigned to a same variable. That's why we need the program that run on runtime i.e. interpreter in order to dynamically change the memory location. That's why the python is slow.
+ 1
Which of program langage is well python or C,C++C# or another language?
0
It is very simple language that have sort syntax . And easy codes as compared to another languages.
That's why it takes more time to convert man- Made code to machine code .
Many languages has more syntax than python.
Let's see with e.gđđ
In python
print ("hello ")
Whereas in c++
#include <iostream>
using namespace std;
int main()
{
cout << "Hello";
return 0;
}
so lastly we can see in c++ has more syntax so computer easily converted that language .
0
Odiljon Usmonov all programming language are well but python is simple as compare to other programming languages.