Inada Naoki added the comment:
@Marco Sulla
> @methane: well, to be honest, I don't see much difference between the two
> pulls. The major difference is that you merged insertdict_init in
> dict_merge_init.
Not only it but also some simplification which make 10% faster than
Inada Naoki added the comment:
@Mark.Shannon I had seen some speedup on tornado benchmark when I didn't use
PGO+LTO. but it was noise.
Now I use PGO+LTO. master vs PR-22909:
$ ./python -m pyperf compare_to master-opt.json speedup_kw-opt.json -G
--min-speed=1
Slower (11):
- spectral_norm
Inada Naoki added the comment:
I close this issue for now. Please reopen or create a new issue if you came up
with better idea.
--
resolution: -> rejected
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10 -P
Inada Naoki added the comment:
@Marco Sulla Please take a look at GH-22909. It is simplified version of your
PR. And I wrote another optimization based on it #42126.
--
___
Python tracker
<https://bugs.python.org/issue41
Inada Naoki added the comment:
It is difficult to estimate. Real world applications has different code-style
than stdlib. And pyperformance didn't include whole real world applications too.
Some application may use dict display in heavy loop. But it is difficult to say
how much exactly.
One
Inada Naoki added the comment:
$ ./python -m pyperf timeit --compare-to ~/pyenv/versions/3.10-dev/bin/python
'{}'
/home/inada-n/pyenv/versions/3.10-dev/bin/python: . 23.5 ns
+- 0.2 ns
/home/inada-n/work/python/cpython/python: . 22.4 ns +- 0.1
ns
Mean
Change by Inada Naoki :
--
keywords: +patch
pull_requests: +21842
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/22911
___
Python tracker
<https://bugs.python.org/issu
New submission from Inada Naoki :
BUILD_CONST_KEY_MAP can be optimized based on #41835 optimization.
1. compiler checks keys tuple is distinct.
2. Add distinct flag to BUILD_CONST_KEY_MAP oparg
To be considered:
* Should we use new opcode, instead of flag in oparg?
* Is this technique safe
Inada Naoki added the comment:
Ok. Performance improvement comes from:
a. Presizing
b. Bypassing some checks in PyDict_SetItem
c. Avoiding duplication check.
(b) is relatively small so I tried to focus on (a) and (b). See GH-22909.
In case of simple keyword arguments, it is 10% faster than
Change by Inada Naoki :
--
keywords: +patch
pull_requests: +21840
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/22909
___
Python tracker
<https://bugs.python.org/issu
Inada Naoki added the comment:
I had suspected that pypeformance just don't have enough workload for non-small
int.
For example, spectral_norm is integer heavy + some float warkload. But
bm_spectral_norm uses `DEFAULT_N = 130`. So most integers are fit into smallint
cache.
On the othar
Inada Naoki added the comment:
I heard pyperformance 1.0.0 works and here is the result of PR-22884.
$ ./python-master -m pyperf compare_to master.json patched.json -G --min-speed=1
Slower (8):
- pathlib: 26.3 ms +- 0.3 ms -> 26.8 ms +- 0.4 ms: 1.02x slower (+2%)
- chameleon: 12.8 ms +-
Inada Naoki added the comment:
I updated the patch.
I can not run pyperformance for now, because:
AssertionError: would build wheel with unsupported tag ('cp310', 'cp310',
'linux_x86_64'
I added this config, but it can not solve the problem:
```
$ cat ~/.config/pip/pip.conf
[global
Change by Inada Naoki :
--
pull_requests: +21823
pull_request: https://github.com/python/cpython/pull/22884
___
Python tracker
<https://bugs.python.org/issue24
Inada Naoki added the comment:
One more idea: BINARY_ADD_INT. Operand is int immediate.
This idea can be implemented without opcode cache. I will try it.
--
___
Python tracker
<https://bugs.python.org/issue42
Inada Naoki added the comment:
FWIW, php7 is about 5x faster than Python on spectral norm benchmark.
https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/php-python3.html
There two major reasons:
* PHP uses scalar type for float and int
* PHP uses type-specialized bytecode
Inada Naoki added the comment:
Thank you for reporting with reproducer.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Inada Naoki :
--
resolution: -> not a bug
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
New changeset 8f6787d93db1b6022db44b1e1d22460c2b74f60b by Inada Naoki in branch
'3.9':
bpo-42057: Add a test case (GH-22878)
https://github.com/python/cpython/commit/8f6787d93db1b6022db44b1e1d22460c2b74f60b
Change by Inada Naoki :
--
pull_requests: +21820
pull_request: https://github.com/python/cpython/pull/22878
___
Python tracker
<https://bugs.python.org/issue42
Inada Naoki added the comment:
New changeset 07a44d9572c7746568a7fe2fbcd42127fd6d4019 by Inada Naoki in branch
'3.9':
bpo-42057: Fix peephole optimizer (GH-22802)
https://github.com/python/cpython/commit/07a44d9572c7746568a7fe2fbcd42127fd6d4019
Inada Naoki added the comment:
Can we add search box using DuckDuckGo?
https://duckduckgo.com/?q=site%3Adocs.python.org%2F3%2F+list+append
--
nosy: +methane
___
Python tracker
<https://bugs.python.org/issue42
Inada Naoki added the comment:
New changeset c756c2b507b088919ac0c1aa8b0d8c8bdbdd75ee by Miss Skeleton (bot)
in branch '3.8':
bpo-41819: Fix compiler warning in init_dump_ascii_wstr() (GH-22332)
https://github.com/python/cpython/commit/c756c2b507b088919ac0c1aa8b0d8c8bdbdd75ee
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8
___
Python tracker
<https://bugs.python.or
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: -Python 3.5, Python 3.6, Python 3.7
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
New changeset 19019eccdeeb8dea027bd7766ca9fe2892972da4 by Miss Skeleton (bot)
in branch '3.9':
bpo-41646: Mention path-like objects support in the docs for shutil.copy()
(GH-22208)
https://github.com/python/cpython/commit
Inada Naoki added the comment:
New changeset 6443a8ccc886749f5e83a8ca073006742b605d90 by Miss Skeleton (bot)
in branch '3.8':
bpo-41646: Mention path-like objects support in the docs for shutil.copy()
(GH-22208)
https://github.com/python/cpython/commit
Inada Naoki added the comment:
New changeset d0bfce992c4ce0e6e71f13a993c91903a97a62f3 by Miss Skeleton (bot)
in branch '3.9':
bpo-41744: Package python.props with correct name in NuGet package (GH-22154)
https://github.com/python/cpython/commit/d0bfce992c4ce0e6e71f13a993c91903a97a62f3
Change by Inada Naoki :
--
versions: +Python 3.10 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue30680>
___
___
Python-bugs-list mailing list
Unsub
Inada Naoki added the comment:
> Agreed. It makes great sense that textwrap started as highly ASCII-centric.
> But in the Python 3, Unicode-friendly era, ASCII-biased isn't where we should
> leave things.
It needs Unicode experts. If we support Unicode, we should implemente UAX
Inada Naoki added the comment:
+1
--
versions: +Python 3.10 -Python 3.9
___
Python tracker
<https://bugs.python.org/issue38980>
___
___
Python-bugs-list mailin
Inada Naoki added the comment:
Thank you
--
nosy: +methane
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
New changeset 25492a5b59c5b74328278f195540e318ab87674f by Dong-hee Na in branch
'master':
bpo-41902: Micro optimization for compute_item of range (GH-22492)
https://github.com/python/cpython/commit/25492a5b59c5b74328278f195540e318ab87674f
--
nosy
Change by Inada Naoki :
--
pull_requests: +21759
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/22802
___
Python tracker
<https://bugs.python.org/issu
Change by Inada Naoki :
--
title: pytest case which catch exceptions become segfault -> peephole
optimizer bug relating to JUMP_IF_NOT_EXC_MATCH
___
Python tracker
<https://bugs.python.org/issu
Inada Naoki added the comment:
I confirmed fix42057.patch fix the assertion failure. But I don't know where
and how to write test yet.
--
keywords: +patch
Added file: https://bugs.python.org/file49527/fix42057.patch
___
Python tracker
<ht
Inada Naoki added the comment:
I confirmed the issue. The simple version of the reproducer is:
```
def callee():
raise Exception
def caller():
try:
callee()
except Exception or Exception:
pass
caller()
```
I can see assertion failure consisntently, when I use
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
> In my implementation, there is guards that do early return in those cases and
> there are tests that check that indeed we don't crash of that happens when
> calling the exposed functions
The guard doesn't help much. _PyObject_GC_UNTRACK() is called
Inada Naoki added the comment:
and this:
https://github.com/python/cpython/blob/b67cbbda3a022cec5e2ad929f0531162166e7c8d/Include/internal/pycore_object.h#L111-L113
--
___
Python tracker
<https://bugs.python.org/issue42
Inada Naoki added the comment:
I meant this:
https://github.com/python/cpython/blob/b67cbbda3a022cec5e2ad929f0531162166e7c8d/Include/internal/pycore_object.h#L75-L78
--
___
Python tracker
<https://bugs.python.org/issue42
Change by Inada Naoki :
--
nosy: +Michael.Felt
___
Python tracker
<https://bugs.python.org/issue42030>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Inada Naoki :
--
nosy: +David.Edelsohn
___
Python tracker
<https://bugs.python.org/issue42030>
___
___
Python-bugs-list mailing list
Unsubscribe:
Inada Naoki added the comment:
There are many code that an object is tracked/untracked. This API can cause
fatal error too easily.
I think this API should be exposed only in _testcapi.
--
nosy: +methane
___
Python tracker
<https://bugs.python.
Inada Naoki added the comment:
Thank you for finding/fixing.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
New changeset 2d2af320d94afc6561e8f8adf174c9d3fd9065bc by Kevin Adler in branch
'master':
bpo-41894: Fix UnicodeDecodeError while loading native module (GH-22466)
https://github.com/python/cpython/commit/2d2af320d94afc6561e8f8adf174c9d3fd9065bc
Inada Naoki added the comment:
Yes, please.
--
___
Python tracker
<https://bugs.python.org/issue41894>
___
___
Python-bugs-list mailing list
Unsubscribe:
Inada Naoki added the comment:
OK. Let's use PyUnicode_DecodeLocale() with surrogateescape for consistency.
--
___
Python tracker
<https://bugs.python.org/issue41
Inada Naoki added the comment:
> So the main problem is: should we allow surrogateescape in error message?
Note that error message may be written to file, stream, structured log (JSON).
They may be UTF-8:strict. We can not write surrogateescape-d string to t
Inada Naoki added the comment:
> I think that it is more correct to use the locale encoding. If error messages
> are translated for readability, we should not ruin this by outputting \xXX.
* PyUnicode_DecodeLocale() doesn't support "backslashescape" error handler.
* Error me
Inada Naoki added the comment:
New changeset 35f041dd0171f575fc3adce1709b31fdf45a5ff6 by Phil Elson in branch
'master':
bpo-41376: Fix the documentation of `site.getusersitepackages()` (GH-21602)
https://github.com/python/cpython/commit/35f041dd0171f575fc3adce1709b31fdf45a5ff6
Inada Naoki added the comment:
> I have since changed the PR to use PyUnicode_DecodeFSDefault based on review
> feedback. I was going to say that you will have to fight it out with @methane
> on GH, but I see that that's you. :D Would have been nice if you would have
> left
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Inada Naoki :
--
resolution: -> out of date
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue35291>
___
___
Inada Naoki added the comment:
I succeeded to reproduce it on Ubuntu 20.04.
$ sudo vi /var/lib/locales/supported.d/ja # add "ja_JP.EUC-JP EUC-JP"
$ sudo locale-gen ja_JP.EUC-JP
Generating locales (this might take a while)...
ja_JP.EUC-JP... done
Generatio
Change by Inada Naoki :
--
resolution: -> out of date
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue33235>
___
___
Inada Naoki added the comment:
I have a Linux desktop machine for benchmarking & profiling in my office. But
the machine is offline and I am working from home several weeks.
So please wait several weeks until I confirm your branch.
> This change speeds up the code up to a 30%.
Inada Naoki added the comment:
PyUnicode_AsUTF8 is useful "API". But it can be implemented as C macro, C
inline function, or functions/macros in any other languages using
PyUnicode_AsUTF8AndSize.
PyUnicode_AsUTF8AndSize is more importan
Change by Inada Naoki :
--
versions: +Python 3.10
___
Python tracker
<https://bugs.python.org/issue41784>
___
___
Python-bugs-list mailing list
Unsubscribe:
Inada Naoki added the comment:
+1. It is a very important API.
--
___
Python tracker
<https://bugs.python.org/issue41784>
___
___
Python-bugs-list mailin
Inada Naoki added the comment:
Since we have positional-only argument, can we document it as `seek(offset,
whence=SEEK_SET, /)`?
--
___
Python tracker
<https://bugs.python.org/issue41
Inada Naoki added the comment:
For the record, https://github.com/python/cpython/pull/14691/files reintroduced
`whence=SEEK_SET`.
--
nosy: +inada.naoki
___
Python tracker
<https://bugs.python.org/issue41
Inada Naoki added the comment:
+1
--
___
Python tracker
<https://bugs.python.org/issue41692>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Inada Naoki :
--
nosy: +inada.naoki
___
Python tracker
<https://bugs.python.org/issue39102>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Inada Naoki :
https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files
Current tutorial doesn't mention about encoding and example uses locale
encoding.
Since UTF-8 is major text encoding and many Windows environment doesn't use
UTF-8 by default
Inada Naoki added the comment:
New changeset a4084b9d1e40c1c9259372263d1fe8c8a562b093 by Konge in branch
'master':
bpo-41497: Fix potential UnicodeDecodeError in dis CLI (GH-21757)
https://github.com/python/cpython/commit/a4084b9d1e40c1c9259372263d1fe8c8a562b093
--
nosy
Inada Naoki added the comment:
New changeset 46e19b61d31ba99f049258efa4ff1334856a3643 by Inada Naoki in branch
'master':
bpo-41098: Doc: Add missing deprecated directives (GH-21162)
https://github.com/python/cpython/commit/46e19b61d31ba99f049258efa4ff1334856a3643
Inada Naoki added the comment:
New changeset 54636355805dd2877bb54fbad8d967e1ddd8b553 by Zackery Spytz in
branch 'master':
bpo-39871: Fix an error in a news entry (GH-21749)
https://github.com/python/cpython/commit/54636355805dd2877bb54fbad8d967e1ddd8b553
--
nosy: +inada.naoki
Change by Inada Naoki :
--
versions: -Python 3.5, Python 3.6, Python 3.7
___
Python tracker
<https://bugs.python.org/issue41497>
___
___
Python-bugs-list mailin
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
New changeset d9323a8c6e07071a59dc4c910661db33236c01b2 by Inada Naoki in branch
'master':
bpo-41493: Refactoring dictresize (GH-21751)
https://github.com/python/cpython/commit/d9323a8c6e07071a59dc4c910661db33236c01b2
Change by Inada Naoki :
--
keywords: +patch
pull_requests: +20894
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/21751
___
Python tracker
<https://bugs.python.org/issu
New submission from Inada Naoki :
dictresize accept `minsize` and calculate `newsize` which is `newsize >=
minsize`.
Some caller pass the exact dk_size so calculating `newsize` is not necessary.
Split calculating `newsize` from `minused` into new function.
Additonally, use _Py_bit_len
Inada Naoki added the comment:
New changeset 270b4ad4df795783d417ba15080da8f95e598689 by Inada Naoki in branch
'master':
bpo-36346: Doc: Update removal schedule of legacy Unicode (GH-21479)
https://github.com/python/cpython/commit/270b4ad4df795783d417ba15080da8f95e598689
Inada Naoki added the comment:
For the record, deprecation warning is just a waring. Build failure is coming
from here:
```
yarl/_quoting.c:1245:23: error: lvalue required as left operand of assignment
Py_SIZE(list) = len+1;
```
It is not relating PEP 623, and it has been fixed
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
type: -> performance
___
Python tracker
<https://bugs.python
Inada Naoki added the comment:
New changeset db6d9a50cee92c0ded7c5cb87331c5f0b1008698 by Inada Naoki in branch
'master':
bpo-41431: Optimize dict_merge for copy (GH-21674)
https://github.com/python/cpython/commit/db6d9a50cee92c0ded7c5cb87331c5f0b1008698
Change by Inada Naoki :
--
nosy: +inada.naoki
___
Python tracker
<https://bugs.python.org/issue38605>
___
___
Python-bugs-list mailing list
Unsubscribe:
Inada Naoki added the comment:
Do you know you can use separated build dir?
```
$ mkdir build
$ cd build
$ ../configure --with-pydebug
```
--
nosy: +inada.naoki
___
Python tracker
<https://bugs.python.org/issue41
Change by Inada Naoki :
--
pull_requests: +20819
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/21674
___
Python tracker
<https://bugs.python.org/issu
Inada Naoki added the comment:
PyDict_Copy() is not used in eval loop or calling functions. So removing
clone_combined_dict() is a considerable option.
Another option is to use clone_combined_dict() in dict_merge, instead of adding
dict_copy2().
Pros: No performance regression. PyDict_Copy
Inada Naoki added the comment:
To reduce code size, I am considering to remove clone_combined_dict. I will
check how PyDict_Copy() is performance critical.
This is microbenchmark result of d.copy() and dict(d).
$ ./python -m pyperf timeit --compare-to ./python-master -s
'd=dict.fromkeys
Inada Naoki added the comment:
Microbenchmark for commit cf4f61ce50e07f7ccd3aef991647050c8da058f9.
# timeit -s 'd=dict.fromkeys(range(8))' -- 'dict(d)'
Mean +- std dev: [master] 311 ns +- 2 ns -> [patched] 144 ns +- 1 ns: 2.16x
faster (-54%)
# timeit -s 'd=dict.fromkeys(range(1
Change by Inada Naoki :
--
keywords: +patch
pull_requests: +20813
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/21669
___
Python tracker
<https://bugs.python.org/issu
New submission from Inada Naoki :
Although there are dict.copy() and PyDict_Copy(), dict_merge can be used for
copying dict.
* d={}; d.update(orig)
* d=dict(orig)
* d=orig.copy() # orig has many dummy keys.
--
components: Interpreter Core
messages: 374550
nosy: inada.naoki
priority
Inada Naoki added the comment:
New changeset 855e68855eeb06f8f0319b3366d3a012c2ff2041 by pxinwr in branch
'master':
bpo-31904: Fix test_ftplib failures for VxWorks RTOS (GH-19447)
https://github.com/python/cpython/commit/855e68855eeb06f8f0319b3366d3a012c2ff2041
--
nosy
Inada Naoki added the comment:
New changeset 5798f787779006a94a55ec74a86da4627de90146 by wasiher in branch
'master':
bpo-41340: Removed fallback implementation for strdup (GH-21634)
https://github.com/python/cpython/commit/5798f787779006a94a55ec74a86da4627de90146
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
@fj92f3jj923f923 Would you update the PR to remove the strdup.c?
--
___
Python tracker
<https://bugs.python.org/issue41
Inada Naoki added the comment:
Thank you.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
New changeset 680254a8dc64e3ada00f88a7c42d41eb02108353 by Henry Schreiner in
branch 'master':
bpo-41366: Fix clang warning for sign conversion (GH-21592)
https://github.com/python/cpython/commit/680254a8dc64e3ada00f88a7c42d41eb02108353
--
nosy
Change by Inada Naoki :
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue10879>
___
Change by Inada Naoki :
--
pull_requests: +20706
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/21560
___
Python tracker
<https://bugs.python.org/issu
Change by Inada Naoki :
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python
stage: patch review -> needs patch
___
Python tracker
<https://bugs.python.org/i
Inada Naoki added the comment:
Can we just remove strdup.c? How about hypot.c?
--
nosy: +inada.naoki
___
Python tracker
<https://bugs.python.org/issue41
Inada Naoki added the comment:
This issue is not duplicate of #23882.
In the example, test1 and test1.test2 are namespace package. But they are
specified explicitly.
`./python.exe -m unittest discover test1.test2`
--
___
Python tracker
<ht
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
New changeset 902356a7b0564e2c9659aaec56211de4d37109d0 by Inada Naoki in branch
'master':
bpo-41338: Fix DeprecationWarning in tests (GH-21542)
https://github.com/python/cpython/commit/902356a7b0564e2c9659aaec56211de4d37109d0
501 - 600 of 3038 matches
Mail list logo