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.

Author colorfulappl
Recipients colorfulappl, erlendaasland, larry
Date 2021-12-31.10:18:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1640945887.73.0.115848516756.issue46212@roundup.psfhosted.org>
In-reply-to
Content
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)
```
History
Date User Action Args
2021-12-31 10:18:07colorfulapplsetrecipients: + colorfulappl, larry, erlendaasland
2021-12-31 10:18:07colorfulapplsetmessageid: <1640945887.73.0.115848516756.issue46212@roundup.psfhosted.org>
2021-12-31 10:18:07colorfulappllinkissue46212 messages
2021-12-31 10:18:07colorfulapplcreate