707
Python! (lemmy.ml)
submitted 4 days ago by tfm@europe.pub to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] Ephera@lemmy.ml 1 points 2 days ago

I do think, it's fair to use Python code which uses C under the hood in benchmarks, because it does often match reality. But then it also has to be realistic code. If it's just a single line of Python code, which calls into C and then everything happens there, then there is really no point for you to use Python.

Python only makes sense to use, if you do write some amount of glue code with it. And then it does require significantly more skill to write performant code than it does with many other languages, as lots of costly abstractions are hidden from you. And it often also requires more effort, since you might not find performant libraries, since so much of the ecosystem only has performance as an afterthought. Reality is messy, which is why realistic Python code still tends to do terribly in benchmarks, whether it calls into C or not.

[-] thebestaquaman@lemmy.world 2 points 2 days ago* (last edited 2 days ago)

100 % agree here. If you're testing an actual use-case, it's fair to compare realistic python to realistic C. However, I would argue that at that point you're no longer benchmarking Python vs. C as languages, but Python vs. C for that particular use-case.

this post was submitted on 07 Aug 2025
707 points (97.8% liked)

Programmer Humor

37697 readers
106 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS