[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 55949f988dc1b943796d9852cc4d588c58cc4255 by Victor Stinner in branch 'master': Optimize deque index, insert and rotate() methods https://github.com/python/cpython/commit/55949f988dc1b943796d9852cc4d588c58cc4255 -- ___

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-06 Thread STINNER Victor
STINNER Victor added the comment: Raymond: "Yes, go ahead and apply." Great, done. Thanks for the reviews Serhiy and Raymond. As I wrote, you can consider to use Argument Clinic later, but there is no urgency for that ;-) I close the issue. -- resolution: -> fixed stage: -> resolved

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1c048539200c by Victor Stinner in branch 'default': Optimize deque index, insert and rotate() methods https://hg.python.org/cpython/rev/1c048539200c -- nosy: +python-dev ___ Python tracker

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Yes, go ahead and apply. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-06 Thread STINNER Victor
STINNER Victor added the comment: > Over this looks good. Just one other minor tweak (one that has served me > well elsewhere) would be to bypass the cross-module function call with a > cheap (near zero cost) register variable test: (...) This has just been optimized by Serhiy, change 82d1c8d

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This already was discussed in issue26822. Issue29460 makes _PyArg_NoStackKeywords() cheaper. -- ___ Python tracker ___ __

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Over this looks good. Just one other minor tweak (one that has served me well elsewhere) would be to bypass the cross-module function call with a cheap (near zero cost) register variable test: if (kwnames != NULL && !_PyArg_NoStackKeywords("rotate", kw

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch is simple and technically it looks correct, but I'm not a fan of using FASTCALL outside of Argument Clinic at this stage. The API still can be changed. Fortunately only three deque methods could have a benefit from using FASTCALL. --

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-05 Thread STINNER Victor
STINNER Victor added the comment: deque-2.patch calls _PyArg_NoStackKeywords() before _PyArg_ParseStack(). -- Added file: http://bugs.python.org/file46533/deque-2.patch ___ Python tracker __

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think _PyArg_NoStackKeywords() should be called before _PyArg_ParseStack(), otherwise this can cause not correct error messages. -- ___ Python tracker

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-05 Thread STINNER Victor
Changes by STINNER Victor : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-05 Thread STINNER Victor
New submission from STINNER Victor: Attached patch changes index(), insert() and rotate() functions of the collections.deque type to use FASTCALL calling convention. I chose to only modify these functions since they use METH_VARARGS which requires to create a temporary tuple, whereas other fun