Why is Python SO slow!? 💀 #developer #tech #coder #softwareengineer #software #technology #tech

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

As someone who has to debug code, I would consider dynamic types a con as well.

jaredwilliams
Автор

Oh, I thought because a Python has no legs

Martynyuu
Автор

Python developers explaining why their language being 1000x slower than every other one is a good thing:

Anonymous-urj
Автор

Remember, python is used for AI

It's the special limitation to prevent creating skynet

Gameplayer
Автор

One of Python's strengths is its use as a front end to libraries like NumPy, SciPy, and TensorFlow, which are written in high-level compiled languages like C and C++. I'm guessing that the particle simulation program Lewis described was written entirely in Python. If it had been written using NumPy, it may very well have been faster than the Java version.

rdwells
Автор

I remember one twitter post by Francois chollet(author of keras) in which he says, “The complaints "Python is slow" or "Python is unsafe" seem misguided.

The point of Python isn't to be fast or safe, it's to be flexible and hackable, and to interface well with everything else. It has become successful by serving as a frontend from which to call other libraries”

abdulniyas
Автор

Python *is* compiled to machine code, just on the fly. You can also compile Python to intermediate code just like other languages and this improves the runtime a lot.

actuallyasriel
Автор

Can't wait for when the Python JIT compiler is finally complete

nebula
Автор

You can always combine c/c++ and python. And its relatively easy.

kenbutsuri
Автор

you can use python to convert python code to assembly and then run that assembly

planktonfun
Автор

It's important to clarify what the test is when comparing speeds. Python looks much worse on shorter tasks due to the overhead Python requires on startup. This can be mitigated somewhat when compiling python to .pyc files. At medium tasks, python looks much better. At massive tasks we see the gap widen again, and this can be somewhat mitigated by compiling with optimized bytecode into .pyo files.

Dev time is worlds faster for python and it's portability is fantastic. Debugging is all just personal familiarity, because neither are that hard if you work with it. Portability can be matched by few compiled languages, but most include varying levels of additional steps/setup/tests.

Fighting over languages is silly, because at the end of the day the reason you use one over the other is because:
I'm paid to use [My Language]
I like the control/safety of [My Language]
I like the syntax/structure of [My Language]
I only know [My Language]
I'm conditioned to make fun of [Your Language]

At the end of the day there are workarounds to alter the standard behavior, mitigate the shortcomings, and interact with most APIs with whatever language you choose. If it's Turing complete, then you just need to get gud, lol.

pretzel
Автор

Honestly, I used to be a certified Python hater, but after working in it for a while, it is so nice to use, especially its JSON modules, makes parsing through data so easy.

leodepew
Автор

I just wish there was a mode to have it so you can specify a variables type yourself so Python doesn’t have to do it for you. Would significantly speed up run time.

metgaming
Автор

You also forgot about the compatibility, Python can easily be paired with fast languages like c or rust. I like to write most of the code in python, and write the important functions in rust, that way my code is fast and easity to read.

pretro
Автор

things to note is languages like java and c# are also "interptred" or rather use a runtime. but they also have JIT compilers which convert it into the target machine code on the fly

xx_Ashura_xx
Автор

I'm sticking with C++ Builder and I don't do ML or AI yet.

colinmaharaj
Автор

technically the actual code is not executed line by line, that would be horribly inefficient, it first gets compiled into byte code which is what's executed "line by line"


















🤓 ☝️

senzmaki
Автор

Python is also single threading. Most libraries are C/C++ underneath.

KangoV
Автор

And Java can also be considered slow depending on what you compare it to. Also if parts of the Python code is really slow you can create that function in C / C++ and just call it.

litjellyfish
Автор

A good point about using python in AI: if it used C++ or assembly, it would be already running the world.

rustygear
visit shbcf.ru