This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Use PEP 590 vectorcall to speed up calls to bool()
Type: performance Stage: resolved
Components: Interpreter Core Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: corona10 Nosy List: Mark.Shannon, corona10, pablogsal, vstinner
Priority: normal Keywords: patch

Created on 2020-09-27 13:20 by corona10, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
bench_bool.py corona10, 2020-09-27 13:20
Pull Requests
URL Status Linked Edit
PR 22427 merged corona10, 2020-09-27 13:24
PR 22462 merged corona10, 2020-09-30 13:37
PR 25219 merged corona10, 2021-04-06 14:32
Messages (9)
msg377565 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-09-27 13:20
bool type is well-used builtin types, I noticed that if we use vector call to bool type, it shows the awesome performance enhancement.

Mean +- std dev: [master] 91.4 us +- 3.3 us -> [vectorcall] 48.6 us +- 3.1 us: 1.88x faster (-47%)
msg377605 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-09-28 16:16
New changeset a195bceff7b552c5f86dec7894ff24dcc87235da by Dong-hee Na in branch 'master':
bpo-41870: Use PEP 590 vectorcall to speed up bool()  (GH-22427)
https://github.com/python/cpython/commit/a195bceff7b552c5f86dec7894ff24dcc87235da
msg377606 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-09-28 16:17
Now I close this issue.
Thank you, Mark!
msg377613 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-09-28 18:41
You can put ok<0 test in the if (nargs) branch, to avoid the test when nargs=0.
msg377686 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-09-29 21:56
> You can put ok<0 test in the if (nargs) branch, to avoid the test when nargs=0.
 
+1
msg377735 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-10-01 04:50
New changeset fa7ce080175f65d678a7d5756c94f82887fc9803 by Dong-hee Na in branch 'master':
bpo-41870: Avoid the test when nargs=0 (GH-22462)
https://github.com/python/cpython/commit/fa7ce080175f65d678a7d5756c94f82887fc9803
msg377736 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-10-01 04:52
Now the suggestion is applied!
Thank you Pablo and Victor!!!
msg390341 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2021-04-06 14:30
For the record, following built-in functions now support vectorcall calling convention from Python 3.10!!

Thank you to everyone who works with this :)

- map: bpo-43575
- filter: bpo-43287
- reversed: bpo-41922
- bool: bpo-41870 
- float: bpo-41873
msg390347 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2021-04-06 15:44
New changeset efccff9ac84009ef48e8cb22548ce80940f76533 by Dong-hee Na in branch 'master':
bpo-41870: Update What's News 3.10 about vectorcall (#25219)
https://github.com/python/cpython/commit/efccff9ac84009ef48e8cb22548ce80940f76533
History
Date User Action Args
2022-04-11 14:59:36adminsetgithub: 86036
2021-04-06 15:44:07corona10setmessages: + msg390347
2021-04-06 14:32:25corona10setpull_requests: + pull_request23958
2021-04-06 14:30:16corona10setmessages: + msg390341
2020-10-01 04:52:35corona10setstatus: open -> closed
resolution: fixed
messages: + msg377736

stage: patch review -> resolved
2020-10-01 04:50:47corona10setmessages: + msg377735
2020-09-30 13:38:08corona10setpull_requests: - pull_request21486
2020-09-30 13:37:29corona10setpull_requests: + pull_request21488
2020-09-30 01:34:54corona10setpull_requests: + pull_request21486
2020-09-29 21:56:09pablogsalsetnosy: + pablogsal
messages: + msg377686
2020-09-28 18:41:35vstinnersetmessages: + msg377613
2020-09-28 16:17:17corona10setnosy: + Mark.Shannon
messages: + msg377606
2020-09-28 16:16:26corona10setmessages: + msg377605
2020-09-27 13:26:28corona10setcomponents: + Interpreter Core
2020-09-27 13:24:00corona10setkeywords: + patch
stage: patch review
pull_requests: + pull_request21461
2020-09-27 13:20:58corona10create