this post was submitted on 24 Nov 2024
14 points (88.9% liked)

Technik

455 readers
2 users here now

die Community für alles, was man als Technik beschreiben kann


the community for everything you could describe as technology


Beiträge auf Deutsch oder Englisch


Posts in German or English

founded 7 months ago
MODERATORS
top 5 comments
sorted by: hot top controversial new old
[–] [email protected] 10 points 2 months ago (1 children)

Based on my analysis I'm pleasantly surprised with the performance improvements Python has received in the last couple of years starting with Python 3.11, and I'm also frankly blown away by PyPy, which I expected to be only marginally faster than CPython and is instead running at or close to Node.js speeds. I'm definitely going to play more with PyPy going forward!

That sounds a lot like "yes, Python is that slow".

To be fair, I think devs typically pick a language based on personal preferences, so speed doesn't really matter as long as it's fast enough.

[–] [email protected] 4 points 2 months ago

...and whatever project they're making. You wouldn't use Python in something that does a million matrix calculations, but for basic scripting it's fine.

[–] [email protected] 9 points 2 months ago
[–] [email protected] 1 points 2 months ago* (last edited 2 months ago)

I have found that if it matters for some code I can relatively easily get it withinn a x2 of Java by using one of the many ways to get python code to compile down to native code. Or use a framework like torch, pandas that is already written in c or rust.

The thing is, that most times it doesn’t matter, because you are anyway waiting on other systems or components. Waiting faster is not going to speed things up.

That being said, of course it is possible to write python code that wastes abysmal amounts of energy. And it is easier to code in python, so that is of course easier to do than in other languages. Not sure if that is the fault of the language though.

[–] [email protected] 1 points 2 months ago

I write a a lot of Python. I generally like Python.

It is slow as fuuuuuck. No point in denying it. When we re-wrote parts in Java, we got a 10x speedup. Then we unitonically rewrote it in Rust, and got another 10x speedup. That's not because these languages are awesome, but because Python ist just soooooo slow.