Why is Python so slow? Will it ever be optimized enough to be on par with JS? Will it ever get rid of GIL? Will it ever be truly ready for parallel computing without high cost of multiprocessing (i.e. spinning up a whole new python instance + ipc costs)?
These are genuine questions. I like Python and I'm worried about its future.
Fuck yourself brainlet. Python3 is where it all went to shit
Gabriel Hughes
just don't get fooled by some dump benchmarks
Lincoln Baker
Because taking x30 more time to complete the same task is not an advantage.
Jeremiah Williams
python is a language that's designed to make everything really easy and versatile. it has nothing to do with speed. the modern paradigm is to call fast algorithms from within python or to prototype with python and then deploy with fast languages. making python fast makes no sense and probably isn't possible. if another language finally usurps python it will be one that's equally easy but is also fast.
Caleb Hill
>if another language finally usurps python it will be one that's equally easy but is also fast. JS.
Parker Watson
lol
Luke Brooks
Why not? It is faster and arguably it takes the same amount of time to write JS code.
Lucas Campbell
I assume CPython for the following questions: >Why is Python so slow? Because it doesn't have a billion-dollar corporation with enough manpower to end slavery, rare earth mines and all misery in the world powering it. Unlike the following: >Will it ever be optimized enough to be on par with JS? Not as fast as V8, no. >Will it ever get rid of GIL? Removing the GIL limits performance even more, as far as I recall because a lot of the core needs to be made thread-safe. >Will it ever be truly ready for parallel computing without high cost of multiprocessing (i.e. spinning up a whole new python instance + ipc costs)? It already is for I/O-bound code where the GIL is released. For CPU-bound code, the answer is no.
Aiden Fisher
because you're not using numpy, numba or any of the other shit you should be using if speed is an issue
Asher Brown
bump
Ryder Lewis
If you want speed wrap it with C which is what Node does for you.
Or use C wrapped libraries like numpy which someone already said.
Ryan Flores
>why is my native code faster than my interpreted code
very good thread op
Lincoln Clark
*Go
Josiah Wood
This. It’s plenty fast if you aren’t retarded
Carson Taylor
Why do I have to do extra work to make python faster if JS just works and it is already fast enough?
John Barnes
>it just works when running it in a C runtime env Okay, so write JS then. No one cares?
Xavier Kelly
Python devs have convinced themselves that Python is "fast enough" and have chosen to ignore the real problems of their language. Meanwhile Python is getting outdated fast and this thread is yet another proof of how python people try to bury their heads in the sand.
Pic related is 3.8 changelog. They don't even try to address a single issue in their language. All they care about is syntactic sugar. Python is stuck in the early 2000s and cannot compete in the modern age. Single core language in 2020, lul.
It's a scripting language. There's fast libraries available for data if you need them, which is essentially the only niche of the language at this point. It's also trivial to wrap python in C if you need to, which is all the JS frameworks are anyway.
No one learns one language and calls it a day. It's literally a non-issue. Just use what works easiest for whatever you're doing.
Luis Flores
Dumbass, that isn't pre-compiled python. Which is what every server would be running. Not compiling it literally every time it's ran.
Caleb Mitchell
I like Go, but having worked in both Go and Python they aren't really interchangeable. Syntactically they're both expressive and readable, but under the hood they're too different. Python is a quick and dirty "play with your code" interpreted language where Go is a no-frills compiled language for infastructure. Pic related if one wants to learn Golang.
>inb4 tensorflow support or some shit If you're using tensorflow then python isn't your bottleneck.
Ian Foster
>tensorflow pypy doesn't even support some of the standard libraries. It is literally DOA.
Gabriel Mitchell
Still has the GIL problem.
Nathan Gray
The GIL is released on demand for I/O and data processing by non-standard libs. You're a dumb monkey.
Michael Perry
why not? 30x of like a few 100 milliseconds is hardly an issue in every single domain python is useful in. I use python a lot solely because it's something i can rely on that isn't compiled.
Carson Hill
JS, although easy and fast, isn't as powerfully dynamic as python and can be difficult to wield compared to python in some cases.
Jaxson Roberts
>hurr durr GIL isn't a problem Autistic shill. Even pypy devs acknowledge that GIL in fact IS a problem.
Caleb Turner
it isn't you fucking moron like it isn't a problem in most JS engines. having threads and shared memory in a scripting language overwhelmingly increases the level of difficulty of its use and the costs of spawning children processes and throwing messages isn't all that much. GIL only matters for non I/O based concurrency in python anyhow.
Nicholas Lewis
speed of computing the mandlebrot in python with numpy and numba is at par with C Speaking with experience.
Dominic Morris
Must have been a few years since you checked compatibility. A while ago they changed their cpython api compatibility magic and pretty much everything works now.
Brandon Butler
python doesn't have a GIL. Python is just a set of constructs whose interpreter can be implemented in any language. C implementation (CPython) has GIL Java implementation (Jython) and IronPython don't
>Even pypy devs acknowledge that GIL in fact IS a problem because most of them are just shallow programmers who are on the bandwagon of "hating GIL" just for the sake of sounding more obscure and "prestigious". GIL has far more merits than demerits.
>there are now 64 Cores 128 Threads CPUs >GIL effectively limits computations to 1 core per instance >GIL has far more merits than demerits The absolute state of python programmers. You are literally moving in the opposite way.
Anthony Cooper
>The speed of c is comparable to c. Interdasting
Jaxon Ramirez
>python doesn't have a GIL. Python is just a set of constructs whose interpreter can be implemented in any language. Not sure communism, huh?
Elijah Sanchez
When people say 'python', they mean cpython, not pypy or jython or ironpython.
Benjamin Flores
all pythonlets became gotards
Caleb Evans
actually kill yourself. JS is a slow, bloated, insecure as fuck language, and as far as I see it, is a cancer to web dev. But it's easy so retards like you come along, code a few lines of JS, and now you think you're hot shit. You're actually dumb as fuck and if you think because you are in tech, you are smart, you are dead wrong faggot. JS is a cancer on this world just like your shit opinion, and I hope they both die within my lifetime to watch.
>Will it ever be optimized enough to be on par with JS? No >Will it ever get rid of GIL? Maybe, but that won't make it fast. Just somewhat better at multithreaded operations. >Will it ever be truly ready for parallel computing without high cost of multiprocessing Even if the GIL thing is fixed, python is a fundamentally bad choice for anything computing-constrained. Python is good for organizing a bunch of blocking operations (making web requests, reading files, etc) and orchestrating actually efficient utilities to do some real workload. If you're feeling the cost of multiprocessing in python, you should be using another language anyway.
Mason Sanders
The only relevant post in this shit-stained thread full of coping pythonlets
Dominic Brown
> slow and bloated > its async > v8 is c++
Try harder
Mason Nguyen
This is one of the most retarded posts I've seen in a while
Xavier Jackson
>>> def start(): ... first = time.time() ... for n in range(1000000): ... print(n) ... last = time.time() ... print("time: " + str(last-first)) ...
i do that in console python 3.x is getting an average of 6.999214172363281 while python2.7 give me 4.77178788185 why is it still getting support fuck that version
Justin Howard
most of C code isn't thread safe not introducing GIL would make C support for python terrible. Python is so popular only because of how well it emulates C libraries (all of it). This is performance-universality trade off. Just use multiprocessing or some other language if you're so dissatisfied with the GIL. Stop spurring non-sense without knowing the purpose of a language. its merits are incomprehensible by "performance" bigots like you
Tyler Brooks
>without knowing the purpose of a language. Python is a high-level _general-purpose_ programming language. Quote from python.org
Matthew Phillips
and? your point being?
Mason Brooks
My point is you don't have to figure out some specific purpose for the language. The purpose is already stated by the devs. I'd rather trust the python devs than some random schizo Jow Forumstard.
Henry Nelson
bump
Lincoln Moore
dead
Wyatt Kelly
Making Python fast means reimplementing the entire standard library in Python in some language that a JIT can easily optimize across. And seeing how fucking enormous Python is that's pretty difficult. Cython sort of works around this by compiling everything to C so the compiler can work its magic.
Logan Martin
because writing Python is faster. are you starting to get it?
Carter Rodriguez
which scripting language is making Python outdated?
Caleb Brooks
Lua
Bentley Ramirez
lmaoooo
Aaron Reyes
If you cared you'd just write performance sensitive shit in C FFI. I know you people don't because your shit is always slow. But that's the solution for any scripting language.
Adrian Reed
Isn't there shit you can use to "compile" python to C? Seems like that'd be a happy medium.