Quokk.au
  • 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
13
link
fedilink
97
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
13
link
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.
  • _sideffect@lemmy.world
    link
    fedilink
    English
    arrow-up
    16
    ·
    10 months ago

    Just code in C

    • spacecadet@lemm.ee
      link
      fedilink
      English
      arrow-up
      32
      ·
      10 months ago

      Just code in assembly

      • jj4211@lemmy.world
        link
        fedilink
        English
        arrow-up
        19
        ·
        10 months ago

        Just punch the cards

        • sugar_in_your_tea@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          2
          ·
          10 months ago

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

      • GBU_28@lemm.ee
        link
        fedilink
        English
        arrow-up
        8
        ·
        10 months ago

        Just ritualistically wave a magnet near the computer

      • TunaCowboy@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        10 months ago

        Yes.

      • ilega_dh@feddit.nl
        link
        fedilink
        English
        arrow-up
        3
        ·
        10 months ago

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

        • Deceptichum
          link
          fedilink
          English
          arrow-up
          2
          ·
          edit-2
          10 months ago

          Paper‽ What too good for a clay tablet?

    • TunaCowboy@lemmy.world
      link
      fedilink
      English
      arrow-up
      14
      ·
      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
        arrow-up
        12
        ·
        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
        arrow-up
        4
        ·
        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
      arrow-up
      6
      ·
      10 months ago

      How about no.

  • tgm@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    10 months ago

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

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
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1.97K users / day
  • 7.71K users / week
  • 14.7K users / month
  • 33.9K users / 6 months
  • 4 local subscribers
  • 70.5K subscribers
  • 9.51K Posts
  • 300K Comments
  • Modlog
  • mods:
  • L3s@lemmy.world
  • enu@lemmy.world
  • Technopagan@lemmy.world
  • L4sBot@lemmy.world
  • L3s@hackingne.ws
  • L4s@hackingne.ws
  • BE: 0.19.11
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org