• jenesaisquoi@feddit.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 hours 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.

  • dwt@feddit.org
    link
    fedilink
    Deutsch
    arrow-up
    1
    ·
    edit-2
    5 hours 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.

  • sbv@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    10
    ·
    11 hours ago

    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@feddit.org
      link
      fedilink
      English
      arrow-up
      4
      ·
      4 hours 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.