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

https://blog.codingconfessions.com/p/are-function-calls-still-slow-in-python

100 points · 12 comments · view on lemmy.world

12 Comments

tgm@lemmy.world · 4 pts · 2y

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

_sideffect@lemmy.world · -25 pts · 2y (11 replies)

Just code in C

spacecadet@lemm.ee · 33 pts · 2y (6 replies)

Just code in assembly

jj4211@lemmy.world · 19 pts · 2y (1 reply)

Just punch the cards

sugar_in_your_tea@sh.itjust.works · 1 pts · 2y

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

GBU_28@lemm.ee · 7 pts · 2y

Just ritualistically wave a magnet near the computer

TunaCowboy@lemmy.world · 3 pts · 2y

Yes.

ilega_dh@feddit.nl · 2 pts · 2y (1 reply)

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

Deceptichum@quokk.au · 2 pts · 2y
[ removed ]
TunaCowboy@lemmy.world · 7 pts · 2y (2 replies)

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 · 11 pts · 2y

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 · -7 pts · 2y

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 · 2 pts · 2y

How about no.