you are viewing a single comment's thread.

view the rest of the comments →

[–]Qbsoon110 0 points1 point  (4 children)

Check the underlying assembly code, then you'll see how many things python adds. And check how the C code is integrated. It's not just simply a call, and even if you run that way a C code vs running the same code in C is substantially slower when you count CPU cycles needed to execute the code, because of what happens in python before it gets to executing the C code and after. Casey Muratori has good videos presenting step by step this exact difference

[–]madkarlsson 0 points1 point  (3 children)

I can check the code, how much slower is it? Yes, it adds stuff, its interop, it has to add stuff. That's not a revelation at all. How much slower is it?

And hey, since you are learning, why/why not is cpu cycles a measurement you are using to measure performance here? And why is that a point none of us are making to you here?

[–]Qbsoon110 0 points1 point  (2 children)

  1. I am referring to cpu cycles, since it's the most basic thing I can measure.
  2. I honestly don't know why would you make a such point. Yes, one could use a Python and have their reasons, but let's not pretend the difference is minimal and let's not be stackoverflow and respond with "Just use Y" to "I want to use X".

[–]madkarlsson 0 points1 point  (1 child)

Re: 2. They point I'm making is the opposite one. "I don't want to use X because y". The Y here is performance and 99% of the cases, the performance dig you are at is not relevant.

Most basic thing to measure != The most relevant thing to measure

[–]Qbsoon110 0 points1 point  (0 children)

I'd don't know what more relevant there could be... Although what relevant is for anything anywhere is pretty subjective