[issue30040] new empty dict can be more small

2017-04-11 Thread INADA Naoki
INADA Naoki added the comment: Thank you for your reply. Would you try to check how the patch [1] affects memory usage of your application? I think the patch can be applied to 3.6 easily. [1] https://patch-diff.githubusercontent.com/raw/python/cpython/pull/1080.patch

[issue29961] More compact sets and frozensets created from sets

2017-04-01 Thread INADA Naoki
INADA Naoki added the comment: OK, sorry about bothering you. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29961> ___ ___ Pyth

[issue29961] More compact sets and frozensets created from sets

2017-04-01 Thread INADA Naoki
INADA Naoki added the comment: I also feel set created from iterator is too large sometimes. Especially, frozenset is used for "unordered tuple" dict key sometimes. $ python -c 'N = 6000; from sys import getsizeof; s = [getsizeof(frozenset(range(n))) for n in range(N)]; print( [(n, s

[issue29952] "keys and values" is preferred to "keys and elements" for name of dict constituent

2017-03-31 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +819 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29952> ___

[issue29952] "keys and values" is preferred to "keys and elements" for name of dict constituent

2017-03-31 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +820 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29952> ___

[issue29949] sizeof set after set_merge() is doubled from 3.5

2017-03-30 Thread INADA Naoki
INADA Naoki added the comment: https://gist.github.com/methane/8faf12621cdb2166019bbcee65987e99 This patch fixes the regression. But I think it is still larger than idiomatic. See this code: code: minused *= 2; /* Find the smallest table size > minused. */ /* XXX speed

[issue29952] "keys and values" is preferred to "keys and elements" for name of dict constituent

2017-03-30 Thread INADA Naoki
INADA Naoki added the comment: New changeset cdcac039fb447f2ab04efcacbe663751bb2cb4ec by INADA Naoki (cocoatomo) in branch 'master': bpo-29952: Use usual terminology of dict (GH-917) https://github.com/python/cpython/commit/cdcac039fb447f2ab04efcacbe663751bb2cb4ec -- nosy

[issue29952] "keys and values" is preferred to "keys and elements" for name of dict constituent

2017-03-31 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +821 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29952> ___

[issue29952] "keys and values" is preferred to "keys and elements" for name of dict constituent

2017-03-31 Thread INADA Naoki
INADA Naoki added the comment: New changeset 5aa913d72317d7632781fb71a7b45a2b5e31558e by INADA Naoki in branch '2.7': bpo-29952: Use usual terminology of dict (GH-924) https://github.com/python/cpython/commit/5aa913d72317d7632781fb71a7b45a2b5e31558e

[issue29949] sizeof set after set_merge() is doubled from 3.5

2017-04-01 Thread INADA Naoki
INADA Naoki added the comment: New changeset e82cf8675bacd7a03de508ed11865fc2701dcef5 by INADA Naoki in branch 'master': bpo-29949: Fix set memory usage regression (GH-943) https://github.com/python/cpython/commit/e82cf8675bacd7a03de508ed11865fc2701dcef5

[issue29949] sizeof set after set_merge() is doubled from 3.5

2017-04-01 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +1127 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29949> ___

[issue29949] sizeof set after set_merge() is doubled from 3.5

2017-04-01 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +1125 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29949> ___

[issue29949] sizeof set after set_merge() is doubled from 3.5

2017-04-01 Thread INADA Naoki
INADA Naoki added the comment: New changeset efde51ad54c58353f25ff80c8d30dbee82ef33a3 by INADA Naoki in branch '3.6': bpo-29949: Fix set memory usage regression (GH-945) https://github.com/python/cpython/commit/efde51ad54c58353f25ff80c8d30dbee82ef33a3

[issue29949] sizeof set after set_merge() is doubled from 3.5

2017-04-01 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue30040] new empty dict can be more small

2017-04-11 Thread INADA Naoki
INADA Naoki added the comment: > I mean creating a solo empty dict doesn't seem to make much sense. Although > it saves memory, but when it's populated, it's resized and the memory > occupation comes back. But sometimes it's not populated. class A: def __init__(self,

[issue30048] If a task is canceled at the right moment, the cancellation is ignored

2017-04-12 Thread INADA Naoki
INADA Naoki added the comment: When task.cancel() called, CancelledError is thrown to coro2. But coro2 doesn't call `yield from` after task.cancel(). So the exception is never raised. If you add `yield from` after `task.cancel()`, the script runs expected. --- $ cat at.py import asyncio

[issue29178] Adding bytes.frombuffer(byteslike) constructor

2017-04-12 Thread INADA Naoki
INADA Naoki added the comment: FYI, Tornado 4.5b switched buffer implementation from deque-of-bytes to bytearray like asyncio. I sent PR for fixing "unreleased memoryview". https://github.com/tornadoweb/tornado/pull/2008 This is common pitfall when implement

[issue30048] If a task is canceled at the right moment, the cancellation is ignored

2017-04-12 Thread INADA Naoki
INADA Naoki added the comment: This behavior is documented as: https://docs.python.org/3.6/library/asyncio-task.html#asyncio.Task.cancel > Unlike Future.cancel(), this does not guarantee that the task will be > cancelled: the exception might be caught and acted upon, delaying > can

[issue30028] make test.support.temp_cwd() fork-safe

2017-04-10 Thread INADA Naoki
INADA Naoki added the comment: #28156 added HAVE_GETPID check. Maybe, we should have dummy getpid() for CloudABI? -- nosy: +inada.naoki ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30028] make test.support.temp_cwd() fork-safe

2017-04-10 Thread INADA Naoki
INADA Naoki added the comment: > Oh. If os.getpid() is not always available, the documentation should be > updated. Yes, but CloudABI is not officially supported platform. They have many patches to run Python on CloudABI. https://github.com/NuxiNL/cloudabi-ports/tree/master/packages/

[issue30040] new empty dict can be more small

2017-04-11 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- components: +Interpreter Core type: -> resource usage versions: +Python 3.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue30040] new empty dict can be more small

2017-04-11 Thread INADA Naoki
INADA Naoki added the comment: While I think it's preferable that {} and d.clear() have same memory footprint, I need real world example which empty dict affects overall memory usage. I'll check memory usage difference with application I used in this ML thread. https://mail.python.org/pipermail

[issue30040] new empty dict can be more small

2017-04-11 Thread INADA Naoki
INADA Naoki added the comment: > Isn't the latter case the more common one? Creating an empty dict and then > populate it. This is memory usage optimization, not performance optimization. (But I think memory efficiency makes multi process application faster because L3 cache size is l

[issue30040] new empty dict can be more small

2017-04-11 Thread INADA Naoki
INADA Naoki added the comment: macro bench result: $ ./python.default -m perf compare_to -G --min-speed=1 default.json patched.json Slower (11): - scimark_lu: 362 ms +- 13 ms -> 383 ms +- 22 ms: 1.06x slower (+6%) - unpickle_pure_python: 882 us +- 18 us -> 924 us +- 18 us: 1.05x slow

[issue30040] new empty dict can be more small

2017-04-11 Thread INADA Naoki
New submission from INADA Naoki: dict.clear() make the dict to empty key-sharing dict to reduce it's size. New dict can use same technique. $ ./python.default Python 3.7.0a0 (heads/master:6dfcc81, Apr 10 2017, 19:55:52) [GCC 6.2.0 20161005] on linux Type "help", "copyr

[issue30040] new empty dict can be more small

2017-04-11 Thread INADA Naoki
INADA Naoki added the comment: performance impact best case: $ ./python.patched -m perf timeit --compare-to=`pwd`/python.default -- '{}' python.default: . 36.9 ns +- 0.9 ns python.patched: . 25.3 ns +- 0.7 ns Mean +- std dev: [python.default] 36.9 ns

[issue30040] new empty dict can be more small

2017-04-11 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +1223 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30040> ___

[issue30048] If a task is canceled at the right moment, the cancellation is ignored

2017-04-12 Thread INADA Naoki
INADA Naoki added the comment: > The problem is that the task doesn't catch CancelledError, yet it disappears. The problem is CancelledError is not raised, even it's thrown. Task can't catch exception not raised. See below example which demonstrates how task works. --- from asyncio imp

[issue30048] If a task is canceled at the right moment, the cancellation is ignored

2017-04-12 Thread INADA Naoki
INADA Naoki added the comment: > In Evgeny's example the 'task' is 'coro1' (not 'coro2'). It has plenty of > yield points after being cancelled. Since coro1 waiting coro2 when cancelling, Task(coro1).cancel() redirect to Task(coro2).cancel(). But I was wrong about "CancelledErro

[issue30048] If a task is canceled at the right moment, the cancellation is ignored

2017-04-12 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +1240 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30048> ___

[issue29716] Python 3 Module doc still sounds like __init__.py is required

2017-03-03 Thread INADA Naoki
INADA Naoki added the comment: namespace package is very advanced topic. I don't think tutorial should mention it. Putting __init__.py always in normal package is highly recommended. Otherwise, many tools can't distinguish normal directory and python package. 2017/03/04 午前6:26 "James O&

[issue29716] Python 3 Module doc still sounds like __init__.py is required

2017-03-03 Thread INADA Naoki
INADA Naoki added the comment: I think so. namespace package is topic for packaging ecosystem developers, like setuptools and pip. Normal python programmer shouldn't omit __init__.py. Python tutorial is for people who want to be normal python programmer. 2017/03/04 午後1:53 "James O&

[issue29659] Expose the `length` arg from shutil.copyfileobj for public use

2017-03-04 Thread INADA Naoki
INADA Naoki added the comment: How about increasing default value to 32KiB or 64KiB too? binutils's cp works well for most cases, while it doesn't have option to specify blocksize. I want Python's copy functions works nice enough for common cases too. binutils cp uses 128KiB block for normal

[issue29719] "Date" of what's new is confusing

2017-03-04 Thread INADA Naoki
New submission from INADA Naoki: See https://docs.python.org/3/whatsnew/3.6.html At top: :Release: |release| :Date: |today| :Editors: Elvis Pranskevichus <el...@magic.io>, Yury Selivanov <y...@magic.io> This |today| is replaced with day when HTML is build (like "Last upd

[issue29719] "Date" of what's new is confusing

2017-03-04 Thread INADA Naoki
INADA Naoki added the comment: > is the URL for the current 3.6 branch, in other words, what will be in the > next 3.6 release. "next 3.6 release" means 3.6.1? > These are rebuilt as changes are checked in. There are some commit for fixing something after 3.6.0 released.

[issue29688] Add support for Path.absolute()

2017-03-12 Thread INADA Naoki
INADA Naoki added the comment: > posixpath.abspath() collapses "//.." to "", this is not > correct. Not sure about ntpath.abspath(). I feel this is reasonable limitation, and expected behavior for some cases. So I think adding note about this in document i

[issue29806] Requesting version info with lowercase -v or -vv causes an import crash

2017-03-13 Thread INADA Naoki
INADA Naoki added the comment: > 1.On both Amazon Linux AMI Python 2.7.12 and also Anaconda Python 3.6.0, > using lowercase v's causes a crash on some kind of import. Lowercase -v is not version, it's "verbose". and -vv is "very verbose". So it's not crash, ju

[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2017-03-14 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- dependencies: -Document PyEval_Call* functions resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue29592] abs_paths() in site.py is slow

2017-03-14 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue29410] Moving to SipHash-1-3

2017-03-06 Thread INADA Naoki
INADA Naoki added the comment: microbench result: https://gist.github.com/methane/33c7b01c45ce23b67246f5ddaff9c9e7 Not significant ~ very little difference for small data. For 4KB: Median +- std dev: [python.default] 3.26 us +- 0.03 us -> [python.siphash13] 2.03 us +- 0.02 us: 1.60x fas

[issue29676] verbose output of test_cprofile

2017-03-06 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +431 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29676> ___

[issue29676] verbose output of test_cprofile

2017-03-06 Thread INADA Naoki
INADA Naoki added the comment: OK, now I found what caused this difference. lsprof expect `func` is PyCFunction object. But it can be PyMethodDescrObject when LOAD_METHOD is used to call C method. In Modules/_lsprof.c (line 459): case PyTrace_C_CALL: if ProfilerObject *)self

[issue29676] C method is not profiled by lsprof

2017-03-06 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- components: +Interpreter Core -Tests title: verbose output of test_cprofile -> C method is not profiled by lsprof ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue29676] C method is not profiled by lsprof

2017-03-06 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue29719] "Date" of what's new is confusing

2017-03-05 Thread INADA Naoki
INADA Naoki added the comment: I'm sorry, I was wrong. https://docs.python.org/3.5/whatsnew/3.5.html asyncio has "Updates in 3.5.1:" section. provisional package will introduce updates in what's new in bugfix release. So is it OK to just removing Date and Release field? "Date

[issue29719] "Date" of what's new is confusing

2017-03-05 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +404 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29719> ___

[issue29719] "Date" of what's new is confusing

2017-03-05 Thread INADA Naoki
INADA Naoki added the comment: https://docs.python.org/3.7/whatsnew/3.6.html shows: Release:3.7.0a0 Date: February 15, 2017 Is it make sense for you? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29719] "Date" of what's new is confusing

2017-03-06 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +408 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29719> ___

[issue29719] "Date" of what's new is confusing

2017-03-05 Thread INADA Naoki
INADA Naoki added the comment: Additonally, unlike "changelog", "What's New" only shows difference between 3.5 and 3.6. It won't be updated to describe changes between 3.6.0 and 3.6.1. -- ___ Python tracker <rep...

[issue29952] "keys and values" is preferred to "keys and elements" for name of dict constituent

2017-03-31 Thread INADA Naoki
INADA Naoki added the comment: New changeset 4c75fbb485c0e42181aab95c2ae92c597915827c by INADA Naoki in branch '3.6': bpo-29952: Use usual terminology of dict (GH-922) https://github.com/python/cpython/commit/4c75fbb485c0e42181aab95c2ae92c597915827c

[issue29519] weakref spewing exceptions during finalization when combined with multiprocessing

2017-07-31 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +3006 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29519> ___

[issue29519] weakref spewing exceptions during finalization when combined with multiprocessing

2017-07-31 Thread INADA Naoki
INADA Naoki added the comment: [gsutil](https://github.com/GoogleCloudPlatform/gsutil) shows massive "Exception ... ignored" message from this regression. https://twitter.com/minimum2scp/status/890021408482316289 I think we should backport this fix to Python 2.7.14. -

[issue29585] site.py imports relatively large `sysconfig` module.

2017-07-28 Thread INADA Naoki
INADA Naoki added the comment: https://github.com/python/cpython/pull/136/files -if sys.platform == 'darwin': -from sysconfig import get_config_var -if get_config_var('PYTHONFRAMEWORK'): -USER_SITE = get_path('purelib', 'osx_framework_user

[issue29585] site.py imports relatively large `sysconfig` module.

2017-07-28 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +2980 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29585> ___

[issue29585] site.py imports relatively large `sysconfig` module.

2017-07-28 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue29585] site.py imports relatively large `sysconfig` module.

2017-07-28 Thread INADA Naoki
INADA Naoki added the comment: https://docs.python.org/3.6/library/site.html#site.USER_SITE > ~/Library/Python/X.Y/lib/python/site-packages for Mac framework builds So it seems I broke sysconfig.get_path('purelib', 'posix_user'). -- ___ Pyt

[issue29585] site.py imports relatively large `sysconfig` module.

2017-07-28 Thread INADA Naoki
INADA Naoki added the comment: New changeset ba9ddb7eea39a651ba7f1ab3eb012e4129c03620 by INADA Naoki in branch 'master': bpo-29585: fix test fail on macOS Framework build (GH-2928) https://github.com/python/cpython/commit/ba9ddb7eea39a651ba7f1ab3eb012e4129c03620

[issue31085] Add option for namedtuple to name its result type automatically

2017-07-31 Thread INADA Naoki
INADA Naoki added the comment: When subclassing, current __repr__ uses `self.__class__.__name__`. So you get meaningful name already. When automatic generation, I recommend you to use some wrapper to cache same namedtuple, since creating namedtuple on the fly is costly job. I'm afraid

[issue31095] Checking all tp_dealloc with Py_TPFLAGS_HAVE_GC

2017-08-01 Thread INADA Naoki
INADA Naoki added the comment: # collection module dequeiter_dealloc doesn't call Untrack(), but it's safe because it only frees deque and deque_dealloc calls Untrack() dequeiter_dealloc(dequeiterobject *dio) { Py_XDECREF(dio->deque); defdict_dealloc doesn't c

[issue31095] Checking all tp_dealloc with Py_TPFLAGS_HAVE_GC

2017-08-01 Thread INADA Naoki
INADA Naoki added the comment: > dequeiter_dealloc doesn't call Untrack(), but it's safe because it only frees > deque > and deque_dealloc calls Untrack() It may be not true, while I don't have exploit yet. -- ___ Python tra

[issue31095] Checking all tp_dealloc with Py_TPFLAGS_HAVE_GC

2017-08-01 Thread INADA Naoki
INADA Naoki added the comment: # _json module scanner_dealloc() encoder_dealloc() # _struct module unpackiter_dealloc # _ssl module context_dealloc() # Objects/ setiter_dealloc dictiter_dealloc dictview_dealloc # Parser/ ast_dealloc

[issue31095] Checking all tp_dealloc with Py_TPFLAGS_HAVE_GC

2017-08-01 Thread INADA Naoki
INADA Naoki added the comment: > should the base method which calls tp_dealloc do this? Maybe can kill all > birds with one stone. It may be possible, but unclear. Object finalization process is very complicated. I agree that UnTrack object as soon as refcnt=0, and Track onl

[issue31095] Checking all tp_dealloc with Py_TPFLAGS_HAVE_GC

2017-08-01 Thread INADA Naoki
INADA Naoki added the comment: Docs/extending/newtypes.rst and Docs/include/noddy3.c should be updated too. But I'm not good English writer. I need help. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-08-02 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +3023 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue31061> ___

[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-08-02 Thread INADA Naoki
INADA Naoki added the comment: New changeset de34cbe9cdaaf7b85fed86f99c2fd071e1a7b1d2 by INADA Naoki (Alexander Mohr) in branch 'master': bpo-31061: fix crash in asyncio speedup module (GH-2966) https://github.com/python/cpython/commit/de34cbe9cdaaf7b85fed86f99c2fd071e1a7b1d2

[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-08-02 Thread INADA Naoki
INADA Naoki added the comment: New changeset f142e85d22ba135d5205280240f3a2fe1df2649f by INADA Naoki in branch '3.6': bpo-31061: fix crash in asyncio speedup module (GH-2984) https://github.com/python/cpython/commit/f142e85d22ba135d5205280240f3a2fe1df2649f

[issue29304] dict: simplify lookup functions

2017-08-03 Thread INADA Naoki
INADA Naoki added the comment: # microbench https://gist.github.com/methane/db16224a99d12ad4ed170cf3bd45b819 Slower (2): - fromkeys_str: 3.85 us +- 0.07 us -> 4.09 us +- 0.09 us: 1.06x slower (+6%) - fromkeys_int: 4.24 us +- 0.13 us -> 4.48 us +- 0.16 us: 1.06x slower (+6%) Fas

[issue29304] dict: simplify lookup functions

2017-08-03 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue29304] dict: simplify lookup functions

2017-08-03 Thread INADA Naoki
INADA Naoki added the comment: New changeset 778928b0c7aa438c282727535814d73df850693a by INADA Naoki in branch 'master': bpo-29304: Simplify dict lookup functions (GH-2407) https://github.com/python/cpython/commit/778928b0c7aa438c282727535814d73df850693a

[issue31179] Speed-up dict.copy() up to 5.5 times.

2017-08-11 Thread INADA Naoki
INADA Naoki added the comment: I like idea. One worrying point is how to deal with dirty dict. How about do it only when ma_used == keys->dk_nentries? Slightly off topic. Copy on write can be implemented via dk_refcnt. Functions just passing `**kwargs` has temporal copy of dict. And

[issue31166] null pointer deref and segfault in _PyObject_Alloc (obmalloc.c:1258)

2017-08-10 Thread INADA Naoki
INADA Naoki added the comment: I think it's false positive of ASAN. We have dynamically sized block. https://github.com/python/cpython/blob/3b0f620c1a2a21272a9e2aeca6ca1d1ac10f8162/Objects/dict-common.h#L49-L69 dictobject.c:547 calls memcpy to fill the block and head pointer is defined

[issue31166] null pointer deref and segfault in _PyObject_Alloc (obmalloc.c:1258)

2017-08-10 Thread INADA Naoki
INADA Naoki added the comment: But we should check dicts of all parents. It will has significant penalty, especially for classes having long mro (inheriting metaclass from typing module cause long mro). -- ___ Python tracker <rep...@bugs.python.

[issue31166] null pointer deref and segfault in _PyObject_Alloc (obmalloc.c:1258)

2017-08-10 Thread INADA Naoki
INADA Naoki added the comment: As Benjamin commented, this is caused by mutating internal dict. PyType_Lookup() use "method cache", based on "tp_version_tag" in the type object. When you modify internal dict directly, namespace is changed without invalidating tp_version_ta

[issue31149] Add Japanese to the language switcher

2017-08-14 Thread INADA Naoki
INADA Naoki added the comment: My preference is "Japanese". After selecting drop down list, we can type "jap" to select Japanese. On the other hand, we should use IME to input "日本語". It's not so easy as input alphabets. -- _

[issue28638] Optimize namedtuple creation

2017-07-16 Thread INADA Naoki
INADA Naoki added the comment: I like your idea. Would you make pull request? -- resolution: rejected -> status: closed -> open title: Creating namedtuple is too slow to be used in common stdlib (e.g. functools) -> Optimize namedtuple

[issue28638] Optimize namedtuple creation

2017-07-17 Thread INADA Naoki
INADA Naoki added the comment: I respect Raymond's rejection. But I want to write down why I like Jelle's approach. Currently, functools is the only module which is very popular. But leaving this means every new namedtuple makes startup time about 0.6ms slower. This is also problem

[issue28812] Deadlock between GIL and pystate head_mutex.

2017-07-11 Thread INADA Naoki
INADA Naoki added the comment: #30395 is about forking, but this is about multi threading. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue28638] Optimize namedtuple creation

2017-07-19 Thread INADA Naoki
INADA Naoki added the comment: I want to focus on pure Python implementation in this issue. While "40x faster" is more 10x faster than "4x faster", C implementation can boost only CPython and makes maintenance more harder. And sometimes "more 10x faster" is not

[issue29225] distutils.command.install_lib.get_outputs() wrong with extensions built inplace

2017-07-19 Thread INADA Naoki
INADA Naoki added the comment: I thought `inplace` option is for debugging/testing without install, not for installing or packaging. As far as document [1], `inplace=1` in `setup.cfg` is noticed as: "which is probably a bad idea for this option, since always building extensions in-

[issue30188] test_nntplib: random EOFError in setUpClass()

2017-07-26 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +2944 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30188> ___

[issue31043] Tests running twice.

2017-07-26 Thread INADA Naoki
INADA Naoki added the comment: New changeset ede9084476f88f5a86c7eaaac33cdd938e4cce93 by INADA Naoki (Utkarsh Upadhyay) in branch 'master': bpo-31043: fixed test_datetime run twice. (GH-2891) https://github.com/python/cpython/commit/ede9084476f88f5a86c7eaaac33cdd938e4cce93 -- nosy

[issue31043] Tests running twice.

2017-07-26 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue30188] test_nntplib: random EOFError in setUpClass()

2017-07-26 Thread INADA Naoki
INADA Naoki added the comment: New changeset 067931dd95ddfa34297be9c602a796d9f8d9bea3 by INADA Naoki in branch 'master': bpo-30188: fix TypeError in test_nntplib (GH-2892) https://github.com/python/cpython/commit/067931dd95ddfa34297be9c602a796d9f8d9bea3 -- nosy: +inada.naoki

[issue29469] AST-level Constant folding

2017-07-25 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +2909 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29469> ___

[issue29225] distutils.command.install_lib.get_outputs() wrong with extensions built inplace

2017-07-19 Thread INADA Naoki
INADA Naoki added the comment: Sorry, I'm not packaging expert. Please wait for expert for right direction. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue28638] Optimize namedtuple creation

2017-07-19 Thread INADA Naoki
INADA Naoki added the comment: I didn't say "let's not do it". I just want to focus on pure Python implementation at this issue, because this thread is too long already. Feel free to open new issue about C implementation. Even if C implementation is added later, pure Python optimi

[issue29585] site.py imports relatively large `sysconfig` module.

2017-06-29 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +2542 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29585> ___

[issue30815] StringIO uses inefficient PyUnicode_AsUCS4

2017-06-30 Thread INADA Naoki
New submission from INADA Naoki: >From PEP393, PyUnicode_AsUCS4 is inefficient. And C implementation of io.StringIO() uses it. That's why Python 3 is slower than Python 2 on logging_format and logging_simple benchmarks. https://mail.python.org/pipermail/speed/2017-February/000503.html Ma

[issue30815] StringIO uses inefficient PyUnicode_AsUCS4

2017-06-30 Thread INADA Naoki
INADA Naoki added the comment: FYI, https://github.com/python/performance/pull/27 will fix performance regression. Python 3 performance is similar to Python 2 after s/warn/warning/ -- ___ Python tracker <rep...@bugs.python.org>

[issue30804] bolen-dmg-3.x build-installer.py failed

2017-06-30 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +2586 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30804> ___

[issue30804] bolen-dmg-3.x build-installer.py failed

2017-06-30 Thread INADA Naoki
INADA Naoki added the comment: Sorry, It seems I failed to merge local patch. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30815] StringIO uses inefficient PyUnicode_AsUCS4

2017-06-30 Thread INADA Naoki
INADA Naoki added the comment: I'm sorry, it's my mistake. I used vmprof on mac and I thought as_ucs4 is bottleneck. But vmprof on Linux (and perf) shows totally different result. Maybe, current vmprof doesn't work well for native code on macOS. -- resolution: -> not a bug st

[issue29585] site.py imports relatively large `sysconfig` module.

2017-06-29 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue29585] site.py imports relatively large `sysconfig` module.

2017-06-29 Thread INADA Naoki
INADA Naoki added the comment: New changeset 6b42eb17649bed9615b6e6cecaefdb2f46990b2c by INADA Naoki in branch 'master': bpo-29585: Fix sysconfig.get_config_var("PYTHONFRAMEWORK") (GH-2483) https://github.com/python/cpython/commit/6b42eb17649bed9615b6e6cecaefdb

[issue29585] site.py imports relatively large `sysconfig` module.

2017-06-28 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +2530 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29585> ___

[issue29585] site.py imports relatively large `sysconfig` module.

2017-06-28 Thread INADA Naoki
INADA Naoki added the comment: New changeset a8f8d5b4bd30dbe0828550469d98f12d2ebb2ef4 by INADA Naoki in branch 'master': bpo-29585: optimize site.py startup time (GH-136) https://github.com/python/cpython/commit/a8f8d5b4bd30dbe0828550469d98f12d2ebb2ef4

[issue29617] Drop Python 3.4 support from asyncio

2017-04-24 Thread INADA Naoki
INADA Naoki added the comment: New changeset 3e2ad8ec61a322370a6fbdfb2209cf74546f5e08 by INADA Naoki in branch 'master': bpo-29617: Remove Python 3.3 support from asyncio (GH-232) https://github.com/python/cpython/commit/3e2ad8ec61a322370a6fbdfb2209cf74546f5e08

[issue29617] Drop Python 3.4 support from asyncio

2017-04-24 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue30150] raw debug allocators to not return malloc alignment

2017-04-25 Thread INADA Naoki
INADA Naoki added the comment: How it cause problem? I think you should use `malloc()` instead of `PyMem_Malloc()` or other Python memory allocator when you need strict `malloc()` alignment. -- nosy: +inada.naoki ___ Python tracker <

[issue31095] Checking all tp_dealloc with Py_TPFLAGS_HAVE_GC

2017-08-01 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +3019 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue31095> ___

<    4   5   6   7   8   9   10   11   12   13   >