• dwt@feddit.org
    link
    fedilink
    Deutsch
    arrow-up
    1
    ·
    edit-2
    48 minutes 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
    8
    ·
    7 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
      2
      ·
      29 minutes 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.