D
D
Denis84212020-05-06 09:22:57
Python
Denis8421, 2020-05-06 09:22:57

Is there a compiler for python to optimized bytecode?

Is there anything like a compiler for python that would produce more optimized bytecode?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2020-05-06
@firedragon

For some reason, I don’t see such questions in the source code and profiler output.
And always shouting% language hiring% brake.
https://habr.com/ru/post/124388/
https://habr.com/ru/post/157537/
https://habr.com/ru/post/336684/

S
Sergey Pankov, 2020-05-06
@trapwalker

So you want badly written Python code to be optimized when translated to bytecode?
It's a bad idea to use implicit magic and post-processing to throw flaws in the quality of the code.
The bytecode is generated for a very specific virtual machine. The performance of your program depends on the quality and efficiency of your code, as well as the speed of the virtual machine that executes the bytecode. In the case of python, you can use the Java machine by switching to jython . It will also add opportunities for integration with the connection of java code.
If performance has become a bottleneck for you in a Python project, it means that either you chose the wrong language and you should write in C, or you didn’t work on the architecture well: you didn’t use horizontal scaling, incorrectly divided time-consuming tasks into separate processes, allowed excessive connectivity or mutability, where they could be avoided by taking advantage of Python's strengths and bypassing its weaknesses.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question