News for hackers. Stuff that matters.
Re:Python 3.11 vs 3.10 performance by FartyMcFarter on Wednesday July 06, 2022 @11:48AM (#32002689)
> Inlined python functions are called in pure python without needing to jump through C

Given that Python is interpreted, it's quite unclear what this could mean.

Also, what does it mean to "call" an inlined function?? Isn't the point of inline functions that they don't get called at all?

Re:Python 3.11 vs 3.10 performance by enragedcacti on Wednesday July 06, 2022 @12:28PM (#32003292)
It's a little confusing but I don't think they meant inlining in the traditional sense. its more like they inlined the C function wrapper around python functions.

> During a Python function call, Python will call an evaluating C function to interpret that function’s code. This effectively limits pure Python recursion to what’s safe for the C stack.

> In 3.11, when CPython detects Python code calling another Python function, it sets up a new frame, and “jumps” to the new code inside the new frame. This avoids calling the C interpreting function altogether.

> Most Python function calls now consume no C stack space. This speeds up most of such calls. In simple recursive functions like fibonacci or factorial, a 1.7x speedup was observed. This also means recursive functions can recurse significantly deeper (if the user increases the recursion limit). We measured a 1-3% improvement in pyperformance.

Re:Python 3.11 vs 3.10 performance by liuliu on Wednesday July 06, 2022 @12:24PM (#32003216)
It seems to be just previously, it does:

  switch (op) {
    case "call_function":
      interpret(op.function)
    ...
  }
Now it does:

  switch (op) {
    case "call_function":
      ... setup frame objects etc ...
      pc = op.function
      continue
    ....
  }
Not sure if they just "inlined" it or use tail-call elimination trick.
Re:Python 3.11 vs 3.10 performance by outworlder on Wednesday July 06, 2022 @12:46PM (#32003506)
> Given that Python is interpreted, it's quite unclear what this could mean.

Python is compiled. CPython runs bytecode.

(If Python is interpreted, then so is Java without the JIT).

Re:Python 3.11 vs 3.10 performance by gpderetta on Thursday July 07, 2022 @07:02AM (#32012444)
I don't think that calling non-JITed Java 'interpreted' is in any way controversial.
Re:Python 3.11 vs 3.10 performance by FartyMcFarter on Wednesday July 06, 2022 @01:48PM (#32004382)
Fair enough, but that doesn't help understanding the original sentence.