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

submitted a month ago by abhi9u

blog.codingconfessions.com/p/are-function-calls…

99

Log in to comment

13 Comments

tgm a month ago

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

_sideffect a month ago

Just code in C

spacecadet a month ago

Just code in assembly

jj4211 a month ago

Just punch the cards

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

GBU_28 a month ago

Just ritualistically wave a magnet near the computer

TunaCowboy a month ago

Yes.

ilega_dh a month ago

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

Deceptichum 4 weeks ago, edited 4 weeks ago

Paper‽ What too good for a clay tablet?

TunaCowboy a month 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 CPython.

celliern a month 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 a month 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 a month ago

How about no.