3 ms·
Am losing count of all these efforts to rescue Python's performance - they all seem to amount to the same thing: it's not very hard to achieve this if you throw
by zmmmmm 4y ago
Am losing count of all these efforts to rescue Python's performance - they all seem to amount to the same thing: it's not very hard to achieve this if you throw out fundamental aspects that make Python what it is. The premise is always that syntax is the barrier, and that people struggle so much to learn a new syntax that this is what keeps them using Python even though its performance is abysmal. But what if this isn't the right assumption? What if it's not the syntax but the ecosystem - and an ecosystem at that which highly depends on all the dynamic features to achieve what it does. Further than that, what about the assumption that people lacking confidence such that they blocked by learning another syntax are actually up for the challenge of understanding all the constraints and limitations of something that is something like but not quite real Python? These are exactly the people that you would expect to struggle with it.
- ActorNightly 4y agoWhat is this talk about "rescuing" Python performance? Python does not need to be rescued. Its fast enough. For 90% of applications, you are kidding yourself if you need more speed. These are enhancements on Python, where you want to run stuff even faster on par with other languages.
- mrkeen 4y ago> What is this talk about "rescuing" Python performance? Which part don't you like: That python is relatively slow? https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/python3-java.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... Or that people are trying to fix its slowness? See the thread you're currently in.
- ActorNightly 4y agoPython is slower than other languages, yes. Python is not "slow" in the sense that it not applicable to use when you wanna run real world applications. Yours is the equivalent argument for buying a BMW M3 over a Toyota Corolla because it can do a faster lap time around a track and thus is better for your commute, except in the real world with traffic and traffic lights, on a 30 minute commute home, you will probably arrive at your destination 1 minute quicker in the BMW over a Corolla.
- igouy 4y agoOr is the equivalent a BMW M3 over a Fordson tractor? :)
- switchbak 4y agoIts performance and poor support for parallelism has prevented me from using it in places I've wanted to for years. Is it "fast enough"? fast enough 90% of the time? Or just fast enough to leave you uncertain that it's even a good choice? Sorry, we have productive choices now that don't leave me worrying about this situation. I still like it though, and if they could solve those issues I'd probably use it a lot more!
- ActorNightly 4y agoIf you want to crunch a lot of numbers in parallel, GPUs are your friend, and thus C/C++ (or any of the python libraries that already set these up for you). If you are trying to run a lot of executions in parallel where you need the full instruction set of the CPU over a GPU (namely, the compare/jump operations, otherwise known as if statements, for loops, e.t.c), then you are most likely either extremely resource constrained (like writing code for a microprocessor or embedded system), at which point you will still use C/C++, or writing something like a video game, which again is C/C++/C# (or Swift for Apple). For most every other use case, Python is simply applicable with its vast array of libraries. For example, at my work, we use FastUI with orjson for a backend that needs to handle some significant TPS. Its fast enough. Could we write the entire thing in another language and use less ECS containers/EC2 instances? Sure, and we will save on cloud costs but lose massively on developer costs.
- WhatTheFlak 4y agoPython is currently running on 100,000s of CPUs right now. There's an environmental cost to that. Moreover, people have huge python apps that they can't just rewrite and python just isn't fast enough. This has happened so many times. So many man hours have been spent optimizing python code, that we have over a dozen different implementations in just this thread alone and it doesn't include 3 that I know of. Python's current Achilles heel is actually it's performance. It's slow as fuck. Those 10% of applications matter. And faster performance won't hinder anything for people writing 100 line scripts.
- Paddy3118 4y agoPython is a scripting language. It allows me to develop a right answer in record devopment time and with a high degree of confidence that the result does what it needs to do. If, then, there are speed problems then I can optimise my existing code or rewrite sections in other languages, but crucially use my initial code to aid in testing the more obscure rewrites. Most of the time, some thought upfront will tell you if you will need a compiled solution early on, but even then - getting it correct in Python before getting it fast in something like C++ can be faster - the spec is often revised as implementation can change specsand Python is more agile. Execution speed is more than execution speed - you need to be correct, and being fast enough is quality; faster may be wasteful.