- Python Home
- About
- News
- Documentation
- Downloads
- Community
- Foundation
- Developer's Guide
- Issue Tracker
- Issues
- Summaries
- User
- Administration
- Help
Issue46212
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.
Created on 2021-12-31 10:05 by colorfulappl, last changed 2022-04-11 14:59 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| bench-print.py | colorfulappl, 2021-12-31 10:18 | |||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 30312 | open | colorfulappl, 2021-12-31 10:07 | |
| Messages (6) | |||
|---|---|---|---|
| msg409412 - (view) | Author: (colorfulappl) * | Date: 2021-12-31 10:05 | |
When "Augument Clinic generated code" are parsing arguments, the args are packed to a tuple before passing to callee. This may be unnecessary. Pass a raw pointer which points to on-stack varargs, and a varargssize integer to indicate how many varargs are passed, can save the time of tuple creation/destruction and value copy. |
|||
| msg409413 - (view) | Author: (colorfulappl) * | Date: 2021-12-31 10:18 | |
I wrote some microbenchs. Patch: https://github.com/python/cpython/pull/30312/commits/b68176d081e19a3cedbaf2cdb31ecd7690421ec8 Environment: macOS 12.1 clang 13.0.0 configure with --enable-optimizations Result on microbench: ``` +--------------------------------------------+-------------------------+------------------------+ | Benchmark | ./opt_baseline/res.json | ./opt_patched/res.json | +============================================+=========================+========================+ | print(a, b, c) | 917 ns | 820 ns: 1.12x faster | +--------------------------------------------+-------------------------+------------------------+ | print(a, b, c, *v) | 1.56 us | 1.62 us: 1.04x slower | +--------------------------------------------+-------------------------+------------------------+ | print(a, sep='', file=stdout) | 376 ns | 295 ns: 1.27x faster | +--------------------------------------------+-------------------------+------------------------+ | print(*v, sep='', flush=True, file=stdout) | 2.02 us | 1.94 us: 1.04x faster | +--------------------------------------------+-------------------------+------------------------+ | Geometric mean | (ref) | 1.05x faster | +--------------------------------------------+-------------------------+------------------------+ Benchmark hidden because not significant (3): print(a), print(a, sep='', flush=True, file=stdout), print(a, b, c, *v, sep='', flush=True, file=stdout) ``` |
|||
| msg409414 - (view) | Author: Erlend E. Aasland (erlendaasland) * ![]() |
Date: 2021-12-31 11:04 | |
Note that _PyArg_UnpackKeywordsWithVararg is defined with PyAPI_FUNC. Changing its argument spec is strictly a backwards incompatible change, IIUC. |
|||
| msg409659 - (view) | Author: (colorfulappl) * | Date: 2022-01-04 09:36 | |
I am a rookie in Python, did not notice changing PyAPI_FUNC means breaking backward compatibility. I have reverted _PyArg_UnpackKeywordsWithVararg and committed again. |
|||
| msg411129 - (view) | Author: Batuhan Taskaya (BTaskaya) * ![]() |
Date: 2022-01-21 14:04 | |
> Note that _PyArg_UnpackKeywordsWithVararg is defined with PyAPI_FUNC. Changing its argument spec is strictly a backwards incompatible change, IIUC. AFAIK we have committed _PyArg_UnpackKeywordsWithVararg on 3.11 alpha, so I think it should be fine. Also CC: @pablogsal |
|||
| msg411130 - (view) | Author: Erlend E. Aasland (erlendaasland) * ![]() |
Date: 2022-01-21 14:06 | |
> AFAIK we have committed _PyArg_UnpackKeywordsWithVararg on 3.11 alpha, so I think it should be fine. I see, so no ABI worries then. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:54 | admin | set | github: 90370 |
| 2022-01-21 14:06:02 | erlendaasland | set | messages: + msg411130 |
| 2022-01-21 14:04:00 | BTaskaya | set | nosy:
+ pablogsal messages: + msg411129 |
| 2022-01-04 09:36:50 | colorfulappl | set | messages: + msg409659 |
| 2021-12-31 11:04:46 | erlendaasland | set | nosy:
+ BTaskaya messages: + msg409414 |
| 2021-12-31 10:18:07 | colorfulappl | set | files:
+ bench-print.py messages: + msg409413 |
| 2021-12-31 10:07:14 | colorfulappl | set | keywords:
+ patch stage: patch review pull_requests: + pull_request28527 |
| 2021-12-31 10:05:47 | colorfulappl | create | |



