Re: [Python-Dev] New calling convention to avoid temporarily tuples when calling functions

2016-08-24 Thread Victor Stinner
Oh, I found a nice pice of CPython history in Modules/_pickle.c. Extract of Python 3.3: - /* A temporary cleaner API for fast single argument function call. XXX: Does caching the argument tuple provides any real performance benefits? A quick benchmark, on a 2.0GHz Athlon64 3

Re: [Python-Dev] New calling convention to avoid temporarily tuples when calling functions

2016-08-24 Thread Victor Stinner
2016-08-22 10:01 GMT+02:00 Victor Stinner : > The next step is to support keyword parameters. In fact, it's already > supported in all cases except of Python functions: > https://bugs.python.org/issue27809 Serhiy Storchaka proposed to use a single C array for positional and keyword arguments. Keyw

Re: [Python-Dev] New calling convention to avoid temporarily tuples when calling functions

2016-08-22 Thread Victor Stinner
Hi, I pushed the most basic implementation of _PyObject_FastCall(), it doesn't support keyword parameters yet: https://hg.python.org/cpython/rev/a1a29d20f52d https://bugs.python.org/issue27128 Then I patched a lot of call sites calling PyObject_Call(), PyObject_CallObject(), PyEval_CallObject(),

Re: [Python-Dev] New calling convention to avoid temporarily tuples when calling functions

2016-08-08 Thread Yury Selivanov
On 2016-08-08 6:53 PM, Victor Stinner wrote: 2016-08-09 0:40 GMT+02:00 Guido van Rossum : tl;dr I found a way to make CPython 3.6 faster and I validated that there is no performance regression. But is there a performance improvement? Sure. On micro-benchmarks, you can see nice improvements:

Re: [Python-Dev] New calling convention to avoid temporarily tuples when calling functions

2016-08-08 Thread Victor Stinner
2016-08-09 1:36 GMT+02:00 Brett Cannon : > I just wanted to say I'm excited about this and I'm glad someone is taking > advantage of what Argument Clinic allows for and what I know Larry had > initially hoped AC would make happen! To make "Python" faster, not only a few specific functions, "all" C

Re: [Python-Dev] New calling convention to avoid temporarily tuples when calling functions

2016-08-08 Thread Brett Cannon
I just wanted to say I'm excited about this and I'm glad someone is taking advantage of what Argument Clinic allows for and what I know Larry had initially hoped AC would make happen! I should also point out that Serhiy has a patch for faster keyword argument parsing thanks to AC: http://bugs.pyth

Re: [Python-Dev] New calling convention to avoid temporarily tuples when calling functions

2016-08-08 Thread Victor Stinner
2016-08-09 0:40 GMT+02:00 Guido van Rossum : > Hm, I agree that those tuples are probably expensive. I recall that > IronPython boasted faster Python calls by doing something closer to the > platform (in their case I'm guessing C# or the CLR :-). To be honest, I didn't expect *any* speedup just by

Re: [Python-Dev] New calling convention to avoid temporarily tuples when calling functions

2016-08-08 Thread Victor Stinner
2016-08-09 0:40 GMT+02:00 Guido van Rossum : >> tl;dr I found a way to make CPython 3.6 faster and I validated that >> there is no performance regression. > > But is there a performance improvement? Sure. On micro-benchmarks, you can see nice improvements: * getattr(1, "real") becomes 44% faste

Re: [Python-Dev] New calling convention to avoid temporarily tuples when calling functions

2016-08-08 Thread Guido van Rossum
On Mon, Aug 8, 2016 at 3:25 PM, Victor Stinner wrote: > tl;dr I found a way to make CPython 3.6 faster and I validated that > there is no performance regression. But is there a performance improvement? > I'm requesting approval of core > developers to start pushing changes. > > In 2014 during

[Python-Dev] New calling convention to avoid temporarily tuples when calling functions

2016-08-08 Thread Victor Stinner
Hi, tl;dr I found a way to make CPython 3.6 faster and I validated that there is no performance regression. I'm requesting approval of core developers to start pushing changes. In 2014 during a lunch at Pycon, Larry Hasting told me that he would like to get rid of temporary tuples to call functio