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

Technik

330 readers
45 users here now

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

Beiträge auf Deutsch oder Englisch

founded 5 months ago
MODERATORS
top 5 comments
sorted by: hot top controversial new old
[–] sbv@sh.itjust.works 10 points 1 week 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.

[–] ChaoticNeutralCzech 4 points 1 week 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.

[–] Zacryon 9 points 1 week ago
[–] dwt 1 points 1 week ago* (last edited 1 week 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.

[–] jenesaisquoi 1 points 1 week 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.