Console? good, GUI? good, game dev? use Godot engine with its similar language Gdscript, but what else? Ive been seeing AI, Data Science stuff, but whats the point if ita slow?
Console? good, GUI? good, game dev? use Godot engine with its similar language Gdscript, but what else? Ive been seeing AI, Data Science stuff, but whats the point if ita slow?
define slow.
my life has been in C style languages but even i kniw python us a great general purpose language. are you going to use it for high frequency trading? no but most things dont need that speed.
yes its used a lot in ai but also for a ton of linuc scripting. i dont think anyone uses perl anymore.
so in what way was it slow when you used it? what micro seconds were you lookong for?
Python is slow enough to notice in fairly normal usage. Just doing lookups into a dict with thousands of entries, for example, will lead you to researching how to sort and index it.
Python’s great as an interface to C which gives it the illusion of performing well.
Yeah, want to take a bet on how long a single lookup in a dict with 5,000 entries takes on my machine?
It’s a hash table. Can you explain why “sorting and indexing” would improve performance?
You’re talking out your arse.
And honestly - what do you expect for a response with a shitty attack like that? Do you need to be a dick?
I mis-remembered, it was a linear search though a list rather than a dict that was the problem (I think it was a list because we were looking up multiple entries or something from a list of Objects based on a field). O(N) lookup to be sure so not well optimized. But on list of 100,000 items doing 100,000 lookups it is very slow - > 1 minute whereas in Java it was like a few seconds.
Yes - refactoring was the solution. I’m not saying it couldn’t perform better and it did when we re-wrote it. But that’s a low-enough number of items that it surprised me that it was a problem.
An order of magnitude difference between python and java would not surprise me at all, sure.
I wrote a console tictactoe game with primitive AI opponent using both Python and C++ and python takes more time in the background process before making a move than in C++.
Yeah, computationally intensive stuff is going to be slow when implemented in Python. You will find lots of data science libraries for Python that do computationally intensive stuff, but they’re then generally implemented in C/C++ or Rust, with only a thin API layer written in Python.
I started off with programming languages that compiled into binaries. I knew dos and bash well enough but wanted the convenience of scripting, just type in run, no compiling needed. I also wanted it to be cross-platform.
I chose Perl. TBH I loved it, but I kept hearing about all the cool things that would come as soon as Perl 6 was released, so I started waiting, and waiting, and waiting…
The XKCD comic, import antigravity, is literally what convinced me to try python finally. Haven’t really looked back, even 13 years later when Perl 6 was finally released
This probably depends on what CPU someone has, someone with a higher-end CPU (higher-IPC/higher clockspeed) probably will have a better experience.
On older/lower-end CPUs it is more common to see when something is single-threaded especially when it’s also interpreted. Particularly any type of generator/loader, filter, renderer, live audio. Which to be clear, is from a user perspective.
I think with newer CPUs Python’s current speed will be less of a problem but if your intention is game dev I think this is not enough.
Yeah you shouldn’t be game deving with a scripting language. There’s your problems!