Diagon Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@abhi9u@lemmy.world to Technology@lemmy.worldEnglish • 10 months ago

Are Function Calls Still Slow in Python? An Analysis of Recent Optimizations in CPython

blog.codingconfessions.com

external-link
message-square
12
fedilink
87
external-link

Are Function Calls Still Slow in Python? An Analysis of Recent Optimizations in CPython

blog.codingconfessions.com

@abhi9u@lemmy.world to Technology@lemmy.worldEnglish • 10 months ago
message-square
12
fedilink
How costly it is to call functions and builtins in your python code? Does inlining help? How have the recent CPython releases improved performance in these areas?
alert-triangle
You must log in or register to comment.
  • @tgm@lemmy.world
    link
    fedilink
    English
    3•10 months ago

    I thought function calls was one of the decently optimized things in Python

  • @_sideffect@lemmy.world
    link
    fedilink
    English
    -22•10 months ago

    Just code in C

    • @spacecadet@lemm.ee
      link
      fedilink
      English
      30•10 months ago

      Just code in assembly

      • @jj4211@lemmy.world
        link
        fedilink
        English
        15•10 months ago

        Just punch the cards

        • @sugar_in_your_tea@sh.itjust.works
          link
          fedilink
          English
          1•10 months ago

          Just wire up your own gates. It’s not that hard.

      • @TunaCowboy@lemmy.world
        link
        fedilink
        English
        4•10 months ago

        Yes.

      • @GBU_28@lemm.ee
        link
        fedilink
        English
        3•10 months ago

        Just ritualistically wave a magnet near the computer

      • @ilega_dh@feddit.nl
        link
        fedilink
        English
        1•10 months ago

        Don’t write code, why do you need a computer to do your math? Just do it on paper ffs.

    • @TunaCowboy@lemmy.world
      link
      fedilink
      English
      8•10 months ago

      The downvotes are hilarious. Being able to drop down to C is one of python’s selling points, and the title of the post includes the name of the python ref implementation __C__Python.

      • @celliern@lemmy.world
        link
        fedilink
        English
        8•10 months ago

        There is a difference being able to drop down in C and using exclusively C.

        One of the main advantage of python is being to quickly write code, and using C-based library / part of code written in C (or fortran, or rust for what it matters) when needed.

        “just write C” may lack a bit of nuance.

      • @_sideffect@lemmy.world
        link
        fedilink
        English
        -5•10 months ago

        Exactly.

        I don’t really care, people will downvote for any number of reasons, and I know I was right, so it doesn’t bug me

    • @Plopp@lemmy.world
      link
      fedilink
      English
      2•10 months ago

      How about no.

Technology@lemmy.world

!technology@lemmy.world

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !technology@lemmy.world

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


  • @L4s@lemmy.world
  • @autotldr@lemmings.world
  • @PipedLinkBot@feddit.rocks
  • @wikibot@lemmy.world
  • 3.31K users / day
  • 9.48K users / week
  • 16.8K users / month
  • 37K users / 6 months
  • 70.9K subscribers
  • 9.78K Posts
  • 289K Comments
  • Modlog
  • mods:
  • @L3s@lemmy.world
  • enu
  • Technopagan
  • L4sBot
  • L3s
  • @L4s@hackingne.ws
  • BE: 0.19.3
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org