minigubben's lemmy
  • Communities
  • Create Post
  • 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
fedilink
1
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
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 # to comment.
  • tgm@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    10 months ago

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

  • _sideffect@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    10 months ago

    Just code in C

    • Plopp@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      10 months ago

      How about no.

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

      Just code in assembly

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

        Yes.

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

        Just ritualistically wave a magnet near the computer

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

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

        • Deceptichum@quokk.au
          link
          fedilink
          English
          arrow-up
          0
          ·
          edit-2
          10 months ago

          Paper‽ What too good for a clay tablet?

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

        Just punch the cards

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

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

    • TunaCowboy@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      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.

      • _sideffect@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        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

      • celliern@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        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.

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 content.
  3. Be excellent to each another!
  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, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be 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.28K users / day
  • 2.57K users / week
  • 5.59K users / month
  • 8 users / 6 months
  • 0 local subscribers
  • 58.7K subscribers
  • 12.7K Posts
  • 537K Comments
  • Modlog
  • mods:
  • L3s@lemmy.world
  • enu@lemm.ee
  • L4sBot@lemmy.world
  • fry@fry.gs
  • L3s@fry.gs
  • enu@lemmy.world
  • L4sBot@fry.gs
  • BE: 0.19.7
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org