INADA Naoki added the comment:
Agreed.
I won't remove OrderedDict usages which is part of public APIs.
This issue is for finding and removing easy local usages.
--
___
Python tracker
<https://bugs.python.org/is
Change by INADA Naoki :
--
pull_requests: +4890
___
Python tracker
<https://bugs.python.org/issue32360>
___
___
Python-bugs-list mailing list
Unsubscribe:
INADA Naoki added the comment:
Let's remove from these:
* asyncio/base_events.py: Used for local variable.
* email/_header_value_parser.py: Used for local variable.
* json: Examples (in document and docstring) for keeping order, and json.tool.
I don't touch oth
INADA Naoki added the comment:
Hmm, it seems my implementation is 30% slower when many mishit scenario.
Maybe, dict is faster than OrderedDict about massive insert/discard. But I
need to profile it.
On the other hand, GC speed looks about 2x faster as expected.
$ ./python -m perf compare_to
INADA Naoki added the comment:
I found odict.pop() and odict.popitem() is very inefficient because
it look up key multiple times.
odict seems not optimized well and very slow than dict in some area...
I'll try to optimize it in hol
INADA Naoki added the comment:
> Please stop revising every single thing you look at. The traditional design
> of LRU caches used doubly linked lists for a reason. In particular, when
> there is a high hit rate, the links can be updated without churning the
> underlying di
Change by INADA Naoki :
--
keywords: +patch
pull_requests: +4897
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32422>
___
___
Python-
INADA Naoki added the comment:
PR-5008 benchmark:
$ ./python -m perf compare_to master.json patched2.json -G
Faster (9):
- gc(100): 98.3 ms +- 0.3 ms -> 29.9 ms +- 0.4 ms: 3.29x faster (-70%)
- gc(10): 11.7 ms +- 0.0 ms -> 3.71 ms +- 0.03 ms: 3.14x faster (-68%)
- gc(1): 1
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:
New changeset 3070b71e5eedf62e49b8e7dedab75742a5f67ece by INADA Naoki in branch
'master':
bpo-32422: Reduce lru_cache memory usage (GH-5008)
https://github.com/python/cpython/commit/3070b71e5eedf62e49b8e7dedab757
New submission from INADA Naoki :
FYI, Builtin dict is tested for ordering already:
https://github.com/python/cpython/blob/13a6c098c215921e35004f9d3a9b70f601e56500/Lib/test/test_ordered_dict.py#L646-L662
--
nosy: +inada.naoki
___
Python tracker
INADA Naoki added the comment:
How about reusing tp_cache instead of adding new slot?
--
___
Python tracker
<https://bugs.python.org/issue32346>
___
___
Pytho
INADA Naoki added the comment:
In my environment, python -X importtime -c 'import asyncio' speed up from
53.2ms to 51ms.
While I like faster startup time, I don't know 4% speed up is worth enough for
this complexity.
--
___
Python
INADA Naoki added the comment:
Could you show some micro benchmark shows performance benefit?
--
nosy: +inada.naoki
___
Python tracker
<https://bugs.python.org/issue33
INADA Naoki added the comment:
> A little performance optimization, but I think the key is not in
performance optimization.
> The semantics of the dictresize function are not uniform, and it is
inconvenient for others to read. The dictresize function should be split to
make it just resize
INADA Naoki added the comment:
Any comments?
Would you close this issue?
--
___
Python tracker
<https://bugs.python.org/issue33477>
___
___
Python-bugs-list m
New submission from INADA Naoki :
https://github.com/python/cpython/blob/master/Modules/gcmodule.c#L1750-L1763
PyObject_GC_Resize() calls PyObject_REALLOC(), which can change object's
address.
But it doesn't relinking:
g->gc.gc_prev->gc.gc_next = g
g->gc.gc_next->gc.gc
Change by INADA Naoki :
--
keywords: +patch
pull_requests: +6670
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33583>
___
___
Python-
Change by INADA Naoki :
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python
versions: +Python 2.7, Python 3.6, Python 3.7, Python 3.8
___
Python tracker
<https://bugs.python.org/issu
New submission from INADA Naoki :
https://github.com/python/cpython/commit/e348c8d154cf6342c79d627ebfe89dfe9de23817
> We can probably get rid of the double and this union hack all together today.
> That is a slightly more invasive change that can be left for later.
Can we do it for now (
INADA Naoki added the comment:
New changeset 1179f4b40f375af5c59cd4b6be9cc313fa0e1a37 by INADA Naoki in branch
'master':
bpo-33583: Add note in PyObject_GC_Resize() doc (GH-7021)
https://github.com/python/cpython/commit/1179f4b40f375af5c59cd4b6be9cc3
INADA Naoki added the comment:
Make sense.
Then, what about using anonymous struct to make GC code more readable?
typedef union _gc_head {
struct {
union _gc_head *gc_next;
union _gc_head *gc_prev;
Py_ssize_t gc_refs;
-} gc;
+};
double dummy
INADA Naoki added the comment:
Oh,,, while even gcc 4.0 supported it, it is language spec from C11, not C99.
--
___
Python tracker
<https://bugs.python.org/issue33
INADA Naoki added the comment:
I grepped quickly and I can't find existing usage of anonymous union/struct.
--
resolution: -> rejected
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.pyth
INADA Naoki added the comment:
New changeset 2b4ed5da1d599190c3be0084ee235b0a8f0a75ea by INADA Naoki (Miss
Islington (bot)) in branch '3.7':
bpo-33583: Add note in PyObject_GC_Resize() doc (GH-7021)
https://github.com/python/cpython/commit/2b4ed5da1d599190c3be0084ee235b
Change by INADA Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by INADA Naoki :
--
nosy: +inada.naoki
___
Python tracker
<https://bugs.python.org/issue33565>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from INADA Naoki :
Currently, PyGC_Head takes three words; gc_prev, gc_next, and gc_refcnt.
gc_refcnt is used when collecting, for trial deletion.
gc_prev is used for tracking and untracking.
So if we can avoid tracking/untracking while trial deletion, gc_prev and
gc_refcnt can
Change by INADA Naoki :
--
keywords: +patch
pull_requests: +6682
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33597>
___
___
Python-
INADA Naoki added the comment:
$ ./python -m perf compare_to master.json twogc.json -G --min-speed=2
Slower (3):
- scimark_monte_carlo: 268 ms +- 9 ms -> 278 ms +- 8 ms: 1.04x slower (+4%)
- fannkuch: 1.03 sec +- 0.02 sec -> 1.06 sec +- 0.02 sec: 1.03x slower (+3%)
- spectral_norm: 285 m
INADA Naoki added the comment:
$ ./python-gc -c 'import asyncio,sys; sys._debugmallocstats()'
master:
# bytes in allocated blocks=4,011,368
# bytes in available blocks= 136,640
50 unused pools * 4096 bytes = 204,800
# byt
INADA Naoki added the comment:
@Serhiy
php implemented similar idea recently.
https://react-etc.net/entry/improvements-to-garbage-collection-gc-php-7-3-boosts-performance-in-benchmark
In short, each tracked object have only "index" of GC struct, not "pointer".
GC struct is
INADA Naoki added the comment:
In Doc folder:
make clean
make PYTHON=../python venv
/usr/bin/time make html
master:
113.15user 0.41system 1:55.46elapsed 98%CPU (0avgtext+0avgdata
205472maxresident)k
18800inputs+223544outputs (1major+66066minor)pagefaults 0swaps
111.07user
INADA Naoki added the comment:
I can't reproduce it:
File "test1.py", line 19, in do_get_obj
response = s3_client.get_object(Bucket='archpi.dabase.com', Key='style.css')
File
"/Users/inada-n/tmp/boto-leak/venv/lib/python3.6/site-packages/boto
INADA Naoki added the comment:
It seems not a bug of Python.
Maybe, your Python installation is broken, or you have wrong PYTHONPATH envvar.
--
nosy: +inada.naoki
___
Python tracker
<https://bugs.python.org/issue33
INADA Naoki added the comment:
Alexander Mohr:
Thanks, I can reproduce.
I found ResourceWarning is happened when head_object.
re may be used for filtering warning.
You can use `-W always` to see the warnings.
I don't know why the leak happene
INADA Naoki added the comment:
I confirmed the leak on 3.6.5, and I can't reproduce it on 3.7.0b4.
--
___
Python tracker
<https://bugs.python.org/is
INADA Naoki added the comment:
Hmm, GH-4587 is merged in 3.6 branch in last November, but 3.6.5 doesn't
include it?
--
___
Python tracker
<https://bugs.python.org/is
INADA Naoki added the comment:
I was wrong. It is not merged into 3.6 branch.
The pull request is just closed.
Now nothing strange in tracemalloc.
--
___
Python tracker
<https://bugs.python.org/issue33
INADA Naoki added the comment:
> if it could be broken installation or configuration (like incorrectly set
> PYTHONHOME or any other python related environment variables), then this
> crash should be expected every time I invoke python executable and attempt
> to run python script
INADA Naoki added the comment:
> We should maybe dump sys.path into stderr on the specific "unable to load the
> file system codec" error.
In addition to sys.path, I think "What's current python home (prefix and
exec-prefix), and where it come from" is very
INADA Naoki added the comment:
If Python 3.7 is released with current AST form, I don't want to change it
again.
I prefer
* Merge my patch in 3.7rc1, or
* Add compile(..., "multi") mode for "sequence of statements"
--
_
INADA Naoki added the comment:
> The callstack I initially mentioned still has no explanation and we now know
> is not correct.
I don't think so.
The callstack is Python's callstack where caused leak in C. (Python doesn't
call malloc directly)
In this case, local va
INADA Naoki added the comment:
I feel your message is just a complaint, not issue report.
You didn't report any concrete information about your environment. (e.g. How
did you install Python, which bash do you use, `env` output, `which python`
output, etc...)
Your message made I fee
Change by INADA Naoki :
--
keywords: +patch
pull_requests: +6729
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
INADA Naoki added the comment:
I'm not sure it's worth enough for adding more builtin classes.
Adding builtin class means Python interpreter core makes more fat, slow to
start, and hard to maintain.
--
___
Python tracker
<https://bu
INADA Naoki added the comment:
> I think it's a reasonable expectation as a python user to be able to do
> reversed(dict(a=1, b=20) since the order is know defined in the
> specifications.
I agree about "reasonable expectation". But I'm interested in is it
INADA Naoki added the comment:
> Rémi Lapeyre added the comment:
> >> I think it's a reasonable expectation as a python user to be able to
do reversed(dict(a=1, b=20) since the order is know defined in the
specifications.
> > I agree about "reasonable expectation
INADA Naoki added the comment:
> Since there seems to be a consensus about this change being too much, should
> we go back to the first proposal to implement dict.__reversed__ only and not
> reversed for the views, this would greatly reduce the bload or dump the PR as
> a whole
INADA Naoki added the comment:
> B. Revert the feature now for 3.7.0, retargeting for 3.8, and produce a
> 3.7.0b5 on a somewhat shorter cycle to allow downstream users to adapt to the
> removal.
Please note that it can't be reverted simply.
The change was introduced to
INADA Naoki added the comment:
I'm +1 on PR-7121 too.
--
___
Python tracker
<https://bugs.python.org/issue32911>
___
___
Python-bugs-list mailing list
INADA Naoki added the comment:
Even if it is documented, arn't people know it by running their code on Python
3.7? How the document help them?
It's very easy to know `errno` module when find ImportError. And it's much
easier than checking "waht's new" document
INADA Naoki added the comment:
I think it's OK.
--
___
Python tracker
<https://bugs.python.org/issue32911>
___
___
Python-bugs-list mailing list
Unsubscr
INADA Naoki added the comment:
> Is the PR already ready for review?
I think so.
--
___
Python tracker
<https://bugs.python.org/issue33597>
___
___
Python-
INADA Naoki added the comment:
On Wed, May 30, 2018 at 7:14 PM STINNER Victor
wrote:
> STINNER Victor added the comment:
> I asked if this change breaks the stable ABI. Steve Dower replied:
> "Looks like it breaks the 3.7 ABI, which is certainly not allowed at this
time.
INADA Naoki added the comment:
https://github.com/python/cpython/pull/7043/commits/053111f321d792fb26f8be10abba24a980f3590f
I added one micro optimization.
Although it is not relating to two-word-gc directly, it makes gc_collect faster
than master on the microbench (without importing
INADA Naoki added the comment:
Oops, this optimization broke trace module.
I reverted a part of the optimization. Current benchmark is:
$ ./python-patched -m perf timeit --compare-to ./python-master -s "import gc,
doctest, ftplib, asyncio, email, http.client, pydoc, pdb, fractions, de
INADA Naoki added the comment:
You're right. I'll revert the optimization completely...
--
___
Python tracker
<https://bugs.python.org/issue33597>
___
___
INADA Naoki added the comment:
@Victor
Thanks for review.
Do you think buildbots for master branch are sound enough to commit this
change? Or should I wait one more week?
http://buildbot.python.org/all/#/grid?branch=master
--
___
Python tracker
INADA Naoki added the comment:
New changeset f7745e1dcb8e8473cc86112a0213b3f244a07230 by INADA Naoki (Tobias
Kunze) in branch 'master':
bpo-27902: Add compatibility note to Profile docs (GH-7295)
https://github.com/python/cpython/commit/f7745e1dcb8e8473cc86112a0213b3
INADA Naoki added the comment:
New changeset a8eb58546b37a7cd5f332f019bb07388f5212c2d by INADA Naoki (A. Jesse
Jiryu Davis) in branch 'master':
bpo-31849: Fix warning in pyhash.c (GH-6799)
https://github.com/python/cpython/commit/a8eb58546b37a7cd5f332f019bb07388f5212c2d
-
INADA Naoki added the comment:
Can we backport this to 3.7 and 3.6? I think it's safe and helpful.
--
nosy: +inada.naoki
___
Python tracker
<https://bugs.python.org/i
INADA Naoki added the comment:
-Wstrict-prototypes is not included in -Wall and -Wextra.
I created PR-7395 which moves the option to CFLAGS_NODIST, as Serhiy suggested
before.
--
___
Python tracker
<https://bugs.python.org/issue5
Change by INADA Naoki :
--
pull_requests: +7021
___
Python tracker
<https://bugs.python.org/issue5755>
___
___
Python-bugs-list mailing list
Unsubscribe:
INADA Naoki added the comment:
2.7 doesn't have CFLAGS_NODIST and I don't have motivation to manually backport
it to 2.7. (I'm not expert of autotools)
--
___
Python tracker
<https://bugs.py
INADA Naoki added the comment:
https://github.com/python/cpython/blob/f822549653d8d09b5b7dcddfdf12679a787c/Python/pythonrun.c#L391-L399
__file__ and __cached__ are added here. And,
https://github.com/python/cpython/blob/f822549653d8d09b5b7dcddfdf12679a787c/Python/pythonrun.c#L441
Change by INADA Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.6, Python 3.8
___
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
Change by INADA Naoki :
--
pull_requests: +7039
___
Python tracker
<https://bugs.python.org/issue30167>
___
___
Python-bugs-list mailing list
Unsubscribe:
INADA Naoki added the comment:
ISO-2022-* is "stateful" encoding. It uses escape sequence to change state.
So keeping only `pending` is not enough.
>>> enc.encode("abcあいう")
b'abc\x1b$B$"$$$&'
>>> enc.getstate()
0
>>> en
INADA Naoki added the comment:
New changeset e33648484775fa533fc8f1e5cc45f60061d29d54 by INADA Naoki in branch
'master':
bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395)
https://github.com/python/cpython/commit/e33648484775fa533fc8f1e5cc45f6
Change by INADA Naoki :
--
pull_requests: +7065
___
Python tracker
<https://bugs.python.org/issue5755>
___
___
Python-bugs-list mailing list
Unsubscribe:
INADA Naoki added the comment:
New changeset d59f97c8325ba509c9b08d488091f45ca642f0b6 by INADA Naoki in branch
'3.6':
bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395)
https://github.com/python/cpython/commit/d59f97c8325ba509c9b08d488091f4
Change by INADA Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.o
INADA Naoki added the comment:
> `MultibyteCodec_State` can occupy 8 bytes, and `pending` can occupy 2 bytes
> (MAXENCPENDING), we get a total of 10 bytes which I think exceeds what a
> PyLong can represent.
PyLong is "long integer", aka "big integer&qu
INADA Naoki added the comment:
New changeset cebe80b59b7386db3cce904d280dab61d1037e7a by INADA Naoki (Scott
Sanderson) in branch 'master':
bpo-29235: Update document for Profiler's context manager (GH-7331)
https://github.com/python/cpython/commit/cebe80b59b7386db3cce904d2
INADA Naoki added the comment:
New changeset bb6366bd7570ff3b74bc66095540bea78f31504e by INADA Naoki (Anthony
Sottile) in branch 'master':
bpo-17909: Document that json.load can accept a binary IO (GH-7366)
https://github.com/python/cpython/commit/bb6366bd7570ff3b74bc66095540be
INADA Naoki added the comment:
New changeset 396ecb9c3e7fb150eace7bfc733d5b9d0263d697 by INADA Naoki (Andrés
Delfino) in branch 'master':
bpo-33799: Remove non-ordered dicts comments from FAQ
https://github.com/python/cpython/commit/396ecb9c3e7fb150eace7bfc733d5b9d0263d697
-
INADA Naoki added the comment:
New changeset 6860629d87d0f6728ff7430453d4900b695adf7b by INADA Naoki (Andrés
Delfino) in branch 'master':
bpo-33798: Update csv document about dict order (GH-7490)
https://github.com/python/cpython/commit/6860629d87d0f6728ff7430453d490
Change by INADA Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
INADA Naoki added the comment:
Would you try python_startup and python_startup_nosite benchmark with:
* master branch
* All reverse iteraters
* All reverse iteraters + register them in _collections_abc module
--
INADA Naoki
--
___
Python
INADA Naoki added the comment:
> If adding __reversed__ has any effect on the rest of the build, that is pure
> random noise that can be ignored.
Although initialization cost of each one type is small, time for _Py_Ready() is
not negligible. And ABC.register() too. Import ti
INADA Naoki added the comment:
I confirmed the cost is negligible.
python_startup_no_site
==
Mean +- std dev: [master] 7.31 ms +- 0.39 ms -> [reverse] 7.41 ms +- 0.44 ms:
1.01x slower (+1%)
Mean +- std dev: [master] 7.31 ms +- 0.39 ms -> [register] 7.20 ms +- 0
INADA Naoki added the comment:
My patch was quick and dirty.
Please read _collections_abc module and follow the style. (you need to use
temporary variables.)
And new reviter types can be registered to Iterator ABC too.
--
INADA Naoki
Change by INADA Naoki :
--
pull_requests: +7238
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issue30167>
___
___
Python-
Change by INADA Naoki :
--
type: behavior -> enhancement
versions: -Python 2.7, Python 3.6, Python 3.7
___
Python tracker
<https://bugs.python.org/issu
INADA Naoki added the comment:
I think "dictionary" means just "dict-like", and it doesn't implies "ordered".
Glossary doesn't say "dictionary" is ordered too.
So "regular dictionary is ordered now" is not enough reason to stop
New submission from INADA Naoki :
ref: #14807, ffa1d0b8d53f426f1f9a0d47f25440b8994c4fb0
tarfile.filemode is deprecated since Python 3.3.
And it is not exported by __all__.
--
components: Library (Lib)
messages: 319370
nosy: inada.naoki
priority: normal
severity: normal
status: open
Change by INADA Naoki :
--
keywords: +patch
pull_requests: +7276
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33842>
___
___
Py
New submission from INADA Naoki :
ref:
* cgi.escape is deprecated since 3.3. 67317750aff37489fd3fa279413ef20450e7c808
* parse_qs and parse_qsl are deprecated since 2008, before 3.0
https://github.com/python/cpython/commit/c469d4c3aa0a66579d1927f0e5d9630b3ea4024f
--
components
Change by INADA Naoki :
--
keywords: +patch
pull_requests: +7277
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33843>
___
___
Py
INADA Naoki added the comment:
"ordered dictionary" means "dict-like object which preserves insertion order".
Both of dict and OrderedDict is "ordered dictionary".
If we change it to OrderedDict, it make harder to change return type from
OrderedDict to n
INADA Naoki added the comment:
Sometime, we chose weak name like "file-like" or "dictionary" over
"io.TextIOWrapper" or "dict", to avoid making future improvements harder.
If there are no strong reason to specify concrete type, let's keep using we
INADA Naoki added the comment:
We use the word "dictionary" for "dict-like" or "maybe dict or it's subclass"
many places.
I don't feel it worth enough to change all wording about it.
--
nosy: +inada.naoki
__
INADA Naoki added the comment:
> What do you mean by "a generic dictionary"? If it's a dict-like object, then
> it *must* be ordered starting with 3.7.
No. Even though dict is ordered, no guarantee about ordering of "dictionary".
Glossary says:
dictionar
INADA Naoki added the comment:
> Please note that DictReader already mentions "OrderedDict" as a type it
> returns now.
OK, but PR-7535 changes enum too.
> but "dictionary" alone doesn't seem like a good weak name to me, as it's the
> common name of
Change by INADA Naoki :
--
components: Library (Lib)
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: Stop using OrderedDict in enum
versions: Python 3.8
___
Python tracker
<https://bugs.python.org/issue33
Change by INADA Naoki :
--
keywords: +patch
pull_requests: +7314
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33866>
___
___
Py
INADA Naoki added the comment:
I feel "dictionary" implies "most likely dict or it's subclass" too. But I
don't think "ordered dictionary" is bad wording because:
* Historically, dict didn't preserve insertion order.
* Dict subclass can pr
2001 - 2100 of 3039 matches
Mail list logo