A detailed examination of Python 3.12’s internal changes featuring the concept of ‘immortal’ objects, for performance enhancements

  • DefinitelyNotBirds@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    22
    ·
    edit-2
    1 year ago

    !Breaking News: Python Sets New Record in Slowness Competition! Participants in awe of how Python lags behind C++, Java, C#, Ruby, Go and PHP in the race to the finish line. Stay tuned as we watch Python take its leisurely stroll in the world of programming speed!!!

    • Kerfuffle@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      17
      ·
      1 year ago

      Participants in awe of how Python lags behind C++, Java, C#, Ruby, Go and PHP

      Comparing Python to compiled languages is like C++ is pretty unreasonable.

    • xep@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      12
      ·
      1 year ago

      You will appreciate this news then since it’s an optimization that’ll make it faster.

    • InvertedParallax@lemm.ee
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 year ago

      It’s python, it’s supposed to be slow.

      Assembly runs the hardware, c kernel runs the assembly, c++ runs the libraries on the kernel, python runs rhe c++, the human runs the python.

      Used to write all my uis in c++, but the turnaround time for python is just incredible, write the business logic there, if it turns out you’re using it to much lower it to c++.

    • fartsparkles@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      49
      arrow-down
      3
      ·
      edit-2
      1 year ago

      Python isn’t used for the problem space of speed… Try using PHP for data science visualisation. Need a library to solve a problem? Ruby probably doesn’t have it. Need to write a quick script to transform some data? Better spend more time than doing it manually as you accidentally allocate memory incorrectly in C++. Want to scrape a website for some text? Enjoy tonnes of boilerplate and 30 lines of Java vs the three lines of Python.

      Python isn’t about speed, it’s not even about being the best at anything, it’s about being good enough at pretty much any task your average coder needs to pull off in as short a time as possible, all with a single language. Plus, it’s way easier to bounce to another language from Python should you need to (for instance it’s much easier to write a speed-critical component in Go vs the entire application stack in Go - Python has a much lower cognitive load and developers can easily extend or refactor thanks to Pythonic code).

      The amount of Python libraries that are actually written in C is huge and Python makes no attempts to suggest it’s more performant than something like C - why do you think Python bindings even exist?

      Thinking speed is a ding on Python shows a gross lack of knowledge of Python and its purpose.