[issue37151] Calling code cleanup after PEP 590

2019-06-18 Thread Inada Naoki
Inada Naoki added the comment: New changeset c78fe320dbb0da3412d640797eb850753d45c07b by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-37151: use PyVectorcall_Call for all calls of "method" (GH-13972) https://github.com/python/cpython/commit/c78fe320dbb0da3412d6

[issue37233] Use _PY_FASTCALL_SMALL_STACK for method_vectorcall

2019-06-18 Thread Inada Naoki
Inada Naoki added the comment: New changeset 988e6aa322fb61651812fa5a61ec73316c71b041 by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-37233: use _PY_FASTCALL_SMALL_STACK in method_vectorcall (GH-13974) https://github.com/python/cpython/commit/988e6aa322fb61651812fa5a61ec73

[issue37151] Calling code cleanup after PEP 590

2019-06-18 Thread Inada Naoki
Inada Naoki added the comment: New changeset 59543347d12a7717235f941e7fd363d4df92984a by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-37151: remove _PyFunction_FastCallDict (GH-13864) https://github.com/python/cpython/commit/59543347d12a7717235f941e7fd363

[issue27860] Improvements to ipaddress module

2019-06-18 Thread Inada Naoki
Inada Naoki added the comment: OK, I thought I improved only undocumented behavior, but it was documented and previous behavior didn't follow the document. I'll backport PR 12836. -- ___ Python tracker <https://bugs.python.o

[issue27860] Improvements to ipaddress module

2019-06-18 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +14038 pull_request: https://github.com/python/cpython/pull/14200 ___ Python tracker <https://bugs.python.org/issue27

[issue27860] Improvements to ipaddress module

2019-06-19 Thread Inada Naoki
Inada Naoki added the comment: New changeset f532fe5583d29d21e12aa22d8fca13e3bca94fb3 by Inada Naoki in branch '3.7': bpo-27860: ipaddress: fix Interface constructor (GH-14200) https://github.com/python/cpython/commit/f532fe5583d29d21e12aa22d8fca13

[issue27860] Improvements to ipaddress module

2019-06-19 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37340] remove free_list for bound method objects

2019-06-19 Thread Inada Naoki
New submission from Inada Naoki : LOAD_METHOD avoids temporary bound method object. PyObject_CallMethodObjArgs now use same optimization. Now I think there is not enough performance benefit from free_list. When free_list is not used often enough, it may bother obmalloc reuse memory pool

[issue37340] remove free_list for bound method objects

2019-06-19 Thread Inada Naoki
Inada Naoki added the comment: PyCFunction has similar free_list. -- ___ Python tracker <https://bugs.python.org/issue37340> ___ ___ Python-bugs-list mailin

[issue37340] remove free_list for bound method objects

2019-06-19 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +14068 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14232 ___ Python tracker <https://bugs.python.org/issu

[issue37340] remove free_list for bound method objects

2019-06-19 Thread Inada Naoki
Inada Naoki added the comment: GH-14232 uses only one free object instead of at most 256 free list. -- stage: patch review -> ___ Python tracker <https://bugs.python.org/issu

[issue37340] remove free_list for bound method objects

2019-06-19 Thread Inada Naoki
Inada Naoki added the comment: Sorry, I just pushed another idea before I leave my office. I will benchmark both ideas after bpo-37337 is finished. -- ___ Python tracker <https://bugs.python.org/issue37

[issue37340] remove free_list for bound method objects

2019-06-19 Thread Inada Naoki
Inada Naoki added the comment: > Are the benchmark results that you posted above for removing the free list > completely or for the one-element free list as in PR 14232? Yes. I see +3% overhead in several benchmarks and I want to see how one free obj save them. > it's wors

[issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io

2019-06-19 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker <https://bugs.python.o

[issue37348] add _PyUnicode_FROM_ASCII macro

2019-06-20 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +14091 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14264 ___ Python tracker <https://bugs.python.org/issu

[issue37348] add _PyUnicode_FROM_ASCII macro

2019-06-20 Thread Inada Naoki
New submission from Inada Naoki : _PyUnicode_FromASCII(s, len) is faster than PyUnicode_FromString(s) because PyUnicode_FromString() uses temporary _PyUnicodeWriter to support UTF-8. But _PyUnicode_FromASCII("hello", strlen("hello"))` is not as easy as `PyUnico

[issue37348] add _PyUnicode_FROM_ASCII macro

2019-06-20 Thread Inada Naoki
Inada Naoki added the comment: I confirmed at least one measurable speedup: ./python -m pyperf timeit -s 'd={}' -- 'repr(d)' FromString: Mean +- std dev: 157 ns +- 3 ns FROM_ASCII: Mean +- std dev: 132 ns +- 3 ns >>> (15

[issue37348] add _PyUnicode_FROM_ASCII macro

2019-06-20 Thread Inada Naoki
Inada Naoki added the comment: Should we make these APIs public? * rename `_PyUnicode_FromASCII` to `PyUnicode_FromASCIIAndSize`. * add `PyUnicode_FromASCII` as static inline function (without ABI). * add `#define _PyUnicode_FromASCII PyUnicode_FromASCIIAndSize` for source code compatibility

[issue37151] Calling code cleanup after PEP 590

2019-06-20 Thread Inada Naoki
Inada Naoki added the comment: New changeset 7e1a9aacff95c68d284f31666fe293fa2db5406d by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-37151: remove _PyCFunction_FastCallDict (GH-14269) https://github.com/python/cpython/commit/7e1a9aacff95c68d284f31666fe293

[issue37348] add _PyUnicode_FROM_ASCII macro

2019-06-20 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +14097 pull_request: https://github.com/python/cpython/pull/14273 ___ Python tracker <https://bugs.python.org/issue37

[issue37348] Optimize PyUnicode_GetString for short ASCII strings

2019-06-20 Thread Inada Naoki
Inada Naoki added the comment: > Most of changes are in not performance sensitive code. I do not think there > is a benefit of using new macro there. Because I used just sed. > If PyUnicode_FromString() is slow I prefer to optimize it instead of adding > yet one esoteric priv

[issue37348] Optimize PyUnicode_GetString for short ASCII strings

2019-06-20 Thread Inada Naoki
Inada Naoki added the comment: Oh, wait. Why we used _PyUnicodeWriter here? Decoding UTF-8 must not require it. 2-pass is enough. -- ___ Python tracker <https://bugs.python.org/issue37

[issue37348] Optimize PyUnicode_GetString for short ASCII strings

2019-06-21 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +14105 pull_request: https://github.com/python/cpython/pull/14283 ___ Python tracker <https://bugs.python.org/issue37

[issue37348] Optimize PyUnicode_GetString for short ASCII strings

2019-06-21 Thread Inada Naoki
Inada Naoki added the comment: > I don't understand how _PyUnicodeWriter could be slow. It does not > overallocate by default. It's just wrapper to implement efficient memory > management. I misunderstood _PyUnicodeWriter. I thought it caused one more allocation, bu

[issue37348] Optimize PyUnicode_GetString for short ASCII strings

2019-06-21 Thread Inada Naoki
Inada Naoki added the comment: Another micro benchmark: ``` $ ./python-master -m pyperf timeit -o m1.json 'b=b"foobar"' -- 'b.decode()' . Mean +- std dev: 93.1 ns +- 2.4 ns $ ./python -m pyperf timeit -o m2.json 'b=b"foobar"

[issue37348] Optimize PyUnicode_GetString for short ASCII strings

2019-06-21 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +14114 pull_request: https://github.com/python/cpython/pull/14291 ___ Python tracker <https://bugs.python.org/issue37

[issue37348] Optimize PyUnicode_GetString for short ASCII strings

2019-06-21 Thread Inada Naoki
Inada Naoki added the comment: PR 14291 seems simpler than PR 14283. But PR 14283 is faster because _PyUnicodeWriter is a learge struct. master: 3.7sec PR 14283: 2.9sec PR 14291: 3.45sec compiler: gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 without LTO, without PGO

[issue37378] FatalError: initfsencoding python couldn't find codec Module not found: Encodings

2019-06-23 Thread Inada Naoki
Inada Naoki added the comment: There may be a broken pip.exe in your computer. Try `python -VV` to check what python are you using. After that, try `python -m pip`, instead of `pip`. -- nosy: +inada.naoki ___ Python tracker <ht

[issue37348] Optimize PyUnicode_FromString for short ASCII strings

2019-06-23 Thread Inada Naoki
Inada Naoki added the comment: New changeset 770847a7db33b3d4c451b42372b6942687aa6121 by Inada Naoki in branch 'master': bpo-37348: optimize decoding ASCII string (GH-14283) https://github.com/python/cpython/commit/770847a7db33b3d4c451b42372b694

[issue37348] Optimize PyUnicode_FromString for short ASCII strings

2019-06-23 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37378] FatalError: initfsencoding python couldn't find codec Module not found: Encodings

2019-06-23 Thread Inada Naoki
Inada Naoki added the comment: You can use `where pip` to find which pip is used. And you can check `PATH` environment variable and remove unused PATHs. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Pytho

[issue37348] Optimize PyUnicode_FromString for short ASCII strings

2019-06-24 Thread Inada Naoki
Inada Naoki added the comment: This optimization is only for short strings. There is no significant difference for long and non-ASCII strings. ``` # 1000 ASCII $ ./python -m pyperf timeit --compare-to=./python-master -s 'b=b"f"*1000' -- 'b.decode()' python-mas

[issue33926] test_gdb is skipped in builds since gdb is not installed as part of build script

2019-06-27 Thread Inada Naoki
Inada Naoki added the comment: New changeset 667eaffb4e5d03bf8129773f79649c3befaa5b1a by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-33926: enable GDB tests on Travis CI (GH-14395) https://github.com/python/cpython/commit/667eaffb4e5d03bf8129773f79649c3befaa5b1a -

[issue30345] test_gdb fails on Python 3.6 when built with LTO+PGO

2019-06-27 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +14239 pull_request: https://github.com/python/cpython/pull/14423 ___ Python tracker <https://bugs.python.org/issue30

[issue30345] test_gdb fails on Python 3.6 when built with LTO+PGO

2019-06-27 Thread Inada Naoki
Inada Naoki added the comment: New changeset 21cfae107e410bf4b0ab3c142ca4449bc33290f5 by Inada Naoki in branch 'master': bpo-30345: travis: use -Og with --with-pydebug (GH-14423) https://github.com/python/cpython/commit/21cfae107e410bf4b0ab3c142ca444

[issue30345] test_gdb fails on Python 3.6 when built with LTO+PGO

2019-06-27 Thread Inada Naoki
Inada Naoki added the comment: I think test_gdb is useful for 3.8 branch because some PEP 590 relating changes will be backported to it. But I don't know how test_gdb is useful for older branches. -- ___ Python tracker <https://bugs.py

[issue37432] Fix a small param type in allocation.rst

2019-06-28 Thread Inada Naoki
Inada Naoki added the comment: New changeset b4bee03087a3c70cb040e2ce569c828860ed8e87 by Inada Naoki (Hai Shi) in branch 'master': bpo-37432: Doc: Fix signature of PyObject_Del() (GH-14430) https://github.com/python/cpython/commit/b4bee03087a3c70cb040e2ce569c828860ed8e87 -

[issue37337] Add _PyObject_VectorcallMethod() function

2019-06-28 Thread Inada Naoki
Inada Naoki added the comment: New changeset b1263d5a60d3f7ab02dd28409fff59b3815a3f67 by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-37337: Add _PyObject_VectorcallMethod() (GH-14228) https://github.com/python/cpython/commit/b1263d5a60d3f7ab02dd28409fff59

[issue37465] Incorrect documentation for `s#` arguments in C API argument parsing

2019-07-01 Thread Inada Naoki
Inada Naoki added the comment: See note in https://docs.python.org/3.9/c-api/arg.html#strings-and-buffers """ Note: For all # variants of formats (s#, y#, etc.), the type of the length argument (int or Py_ssize_t) is controlled by defining the macro PY_SSIZE_T_CLEAN b

[issue37465] Incorrect documentation for `s#` arguments in C API argument parsing

2019-07-01 Thread Inada Naoki
Inada Naoki added the comment: > Oh! Fair enough, I had missed it. Does the note also involve `Py_BuildValue`? > If so, the documentation of `Py_BuildValue` should probably be updated; if > not, I think it would be clearer if the note mentioned that it only applies > to

[issue37206] Incorrect application of Argument Clinic to dict.pop()

2019-07-01 Thread Inada Naoki
Inada Naoki added the comment: I agree that this is a bug in many API docstrings, and PR 13933 is the right approach to fix all bugs in the future. But in case of dict.pop(), this is not only a bug, but a regression. May I merge PR-13935 to fix the regression in 3.7b2

[issue36904] Implement _PyStack_UnpackDict() with a single allocation

2019-07-02 Thread Inada Naoki
Inada Naoki added the comment: New changeset d4efd917ac24940063a1ce80073fe3570c5f07f8 by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-36904: Optimize _PyStack_UnpackDict (GH-14517) https://github.com/python/cpython/commit/d4efd917ac24940063a1ce80073fe3570c5f07f8 -

[issue37483] Add PyObject_CallOneArg()

2019-07-02 Thread Inada Naoki
Inada Naoki added the comment: What do you think about macro like this? #define _PyObject_CALL_WITH_ARGS(func, ...) \ _PyObject_Vectorcall(func, (PyObject*[]){NULL, __VA_ARGS__} + 1, \ sizeof((PyObject*[]){__VA_ARGS__})/sizeof(PyObject*) | PY_VECTORCALL_ARGUMENTS_OFFSET

[issue37483] Add PyObject_CallOneArg()

2019-07-03 Thread Inada Naoki
Inada Naoki added the comment: AFAIK, gcc, clang, and MSVC support it. Another cons is, general pitfall of macro: _PyObject_CALL_WITH_ARGS(func, PyDict_GetItem(d, key)); // PyDict_GetItem(d, key) is called twice. If two or more arguments are not common, I prefer _PyObject_CallOneArg to

[issue37483] Add PyObject_CallOneArg()

2019-07-03 Thread Inada Naoki
Inada Naoki added the comment: > Macros cannot be used in all C extensions. For the PEP 587, I was asked to > replace macros with functions. This is just an helper inline function / macro to ease calling _PyObject_Vectorcall. Extensions can port this helper inline function / macro t

[issue37483] Add PyObject_CallOneArg()

2019-07-03 Thread Inada Naoki
Inada Naoki added the comment: This change doesn't make caller code complicated. It makes caller little simpler. Choosing performance sensitive code is much hard than replace all occurrences. So I'm OK to change all callers except code owner oppos

[issue37483] Add PyObject_CallOneArg()

2019-07-03 Thread Inada Naoki
Inada Naoki added the comment: > It adds yet another special case underscore function that one cannot use in > external projects. So I would not say that is simpler. I don't get what you mean. Do you care about *adding* API with underscore? If so, it doesn't make caller c

[issue37484] Use PY_VECTORCALL_ARGUMENTS_OFFSET for __exit__

2019-07-03 Thread Inada Naoki
Inada Naoki added the comment: New changeset 469d1a70cecc918499c288fc0e5e3d79711bc5e5 by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-37484: use _PyObject_Vectorcall for __exit__ (GH-14557) https://github.com/python/cpython/commit/469d1a70cecc918499c288fc0e5e3d

[issue37233] Use _PY_FASTCALL_SMALL_STACK for method_vectorcall

2019-07-03 Thread Inada Naoki
Inada Naoki added the comment: New changeset 53c214344038341ce86fcf7efa12dc33be9d5b45 by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-37233: optimize method_vectorcall in case of totalargs == 0 (GH-14550) https://github.com/python/cpyt

[issue37483] Add PyObject_CallOneArg()

2019-07-03 Thread Inada Naoki
Inada Naoki added the comment: I don't want to add many functions to limited/public APIs. Note that public APIs defined outside of cpython/ are considered mandatory for all Python implementations supporting Python/C API. When portability is more important than performance, there are

[issue37233] Use _PY_FASTCALL_SMALL_STACK for method_vectorcall

2019-07-03 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +14391 pull_request: https://github.com/python/cpython/pull/14573 ___ Python tracker <https://bugs.python.org/issue37

[issue37233] Use _PY_FASTCALL_SMALL_STACK for method_vectorcall

2019-07-03 Thread Inada Naoki
Inada Naoki added the comment: New changeset c7570d402e3ee8717615ffa020eb9e2215a77660 by Inada Naoki in branch '3.8': [3.8] bpo-37233: use _PY_FASTCALL_SMALL_STACK in method_vectorcall (GH-13974) https://github.com/python/cpython/commit/c7570d402e3ee8717615ffa020eb9e

[issue37483] Add PyObject_CallOneArg()

2019-07-04 Thread Inada Naoki
Inada Naoki added the comment: New changeset 196a530e00d88a138973bf9182e013937e293f97 by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-37483: add _PyObject_CallOneArg() function (#14558) https://github.com/python/cpython/commit/196a530e00d88a138973bf9182e013

[issue37493] Use _PyObject_CallNoArg() in a few more places

2019-07-04 Thread Inada Naoki
Inada Naoki added the comment: New changeset 7f41c8e0dd237d1f3f0a1d2ba2f3ee4e4bd400a7 by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-37493: use _PyObject_CallNoArg in more places (GH-14575) https://github.com/python/cpython/commit/7f41c8e0dd237d1f3f0a1d2ba2f3ee

[issue29312] Use FASTCALL in dict.update()

2019-07-04 Thread Inada Naoki
Inada Naoki added the comment: How can we avoid unpacking dict in case of d1.update(**d2)? -- ___ Python tracker <https://bugs.python.org/issue29312> ___ ___

[issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict()

2019-07-04 Thread Inada Naoki
Inada Naoki added the comment: Can we call tp_call instead of vectorcall when kwargs is not empty? https://github.com/python/cpython/blob/7f41c8e0dd237d1f3f0a1d2ba2f3ee4e4bd400a7/Objects/call.c#L209-L219 For example, dict_init may be faster than dict_vectorcall when `d2 = dict(**d1

[issue29312] Use FASTCALL in dict.update()

2019-07-04 Thread Inada Naoki
Inada Naoki added the comment: > The unpacking is only a problem if you insist on using PyDict_Merge(). It > would be perfectly possible to implement dict merging from a tuple+vector > instead of from a dict. In that case, there shouldn't be a performance > penalty. Rea

[issue29312] Use FASTCALL in dict.update()

2019-07-04 Thread Inada Naoki
Inada Naoki added the comment: - d2 = dict(**d1) + d2 = {"fizz": "buzz"} + d2.update(**d1) -- ___ Python tracker <https://bugs.python.org/issue29312> ___

[issue29312] Use FASTCALL in dict.update()

2019-07-04 Thread Inada Naoki
Inada Naoki added the comment: OK, `d1.update(**d2)` is not useful in practice. Practical usages of dict.update() are: * d.update(d2) * d.update([(k1,k2),...]) * d.update(k1=v1, k2=v2, ...) * d.update(**d2, **d3, **d4) # little abuse, but possible. In all of them, kwdict is not used at

[issue37483] Add PyObject_CallOneArg()

2019-07-05 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +14414 pull_request: https://github.com/python/cpython/pull/14599 ___ Python tracker <https://bugs.python.org/issue37

[issue37483] Add PyObject_CallOneArg()

2019-07-05 Thread Inada Naoki
Inada Naoki added the comment: New changeset 6e43d07324ca799118e805751a10a7eff71d5a04 by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-37483: fix reference leak in _PyCodec_Lookup (GH-14600) https://github.com/python/cpython/commit/6e43d07324ca799118e805751a10a7

[issue37337] Add _PyObject_VectorcallMethod() function

2019-07-08 Thread Inada Naoki
Inada Naoki added the comment: New changeset 762f93ff2efd6b7ef0177cad57939c0ab2002eac by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267) https://github.com/python/cpython/commit/762f93ff2efd6b7ef0177cad57939c

[issue37055] Numerous warnings with blake2 module

2019-07-08 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +14457 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14646 ___ Python tracker <https://bugs.python.org/issu

[issue29312] Use FASTCALL in dict.update()

2019-07-08 Thread Inada Naoki
Inada Naoki added the comment: > Changing dict.update() calling convention may save a few nanoseconds on > d1.update(d2) call, but it will make d1.update(**d2) way slower with a > complexity of O(n): d2 must be converted to 2 lists (kwnames and args) and > then a new dict shoul

[issue37543] Optimize pymalloc for non PGO build

2019-07-10 Thread Inada Naoki
New submission from Inada Naoki : When PGO is not used, compilers don't know which part is hot. So gcc failed to inline hot code in pymalloc_alloc and pymalloc_free into _PyObject_Malloc and _PyObject_Free. For example, only this code is inlined into _PyObject_Malloc. if (nbytes

[issue37543] Optimize pymalloc for non PGO build

2019-07-10 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +14489 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14674 ___ Python tracker <https://bugs.python.org/issu

[issue37547] Add _PyObject_CallMethodOneArg()

2019-07-11 Thread Inada Naoki
Inada Naoki added the comment: New changeset 59ad110d7a7784d53d0b502eebce0346597a6bef by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-37547: add _PyObject_CallMethodOneArg (GH-14685) https://github.com/python/cpython/commit/59ad110d7a7784d53d0b502eebce03

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

2019-07-11 Thread Inada Naoki
Inada Naoki added the comment: FYI, PyEval_CallFunction and PyEval_CallMethod doesn't respect Py_SSIZE_T_CLEAN. So runtime warning is raised when they are used with "#" format. -- ___ Python tracker <https://bugs.pyt

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

2019-07-11 Thread Inada Naoki
Inada Naoki added the comment: New changeset 1dbd084f1f68d7293718b663df675cfbd0c65712 by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-29548: no longer use PyEval_Call* functions (GH-14683) https://github.com/python/cpython/commit/1dbd084f1f68d7293718b663df675c

[issue37543] Optimize pymalloc for non PGO build

2019-07-17 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37543] Optimize pymalloc for non PGO build

2019-07-17 Thread Inada Naoki
Inada Naoki added the comment: New changeset fb26504d14a08fcd61bb92bb989b6d2b12188535 by Inada Naoki in branch 'master': bpo-37543: optimize pymalloc (#14674) https://github.com/python/cpython/commit/fb26504d14a08fcd61bb92bb989b6d

[issue37587] JSON loads performance improvement for long strings

2019-07-18 Thread Inada Naoki
Inada Naoki added the comment: > 1. remove the mov entirely. It is not needed inside the loop and it is only > needed later, outside the loop to access the variable How can we lazy "movDWORD PTR [rsp+0x44],eax"? -- no

[issue37587] JSON loads performance improvement for long strings

2019-07-18 Thread Inada Naoki
Inada Naoki added the comment: Some compilers produce inefficient code for PR-14752. I wrote another patch which is friendly to more compilers. $ perf record ./python -m pyperf timeit -s "import json; x = json.dumps({'k': '1' * 2 ** 20})" "json.loads(x

[issue37587] JSON loads performance improvement for long strings

2019-07-18 Thread Inada Naoki
Change by Inada Naoki : -- versions: -Python 3.6, Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue37587> ___ ___ Python-bugs-list mailin

[issue37626] Documentation:conflict between docs

2019-07-18 Thread Inada Naoki
Inada Naoki added the comment: https://docs.python.org/3/library/inspect.html#inspect.Parameter.replace """ Changed in version 3.4: In Python 3.3 Parameter objects were allowed to have name set to None if their kind was set to POSITIONAL_ONLY. This is no lo

[issue37547] Add _PyObject_CallMethodOneArg()

2019-07-18 Thread Inada Naoki
Inada Naoki added the comment: New changeset d3952096537d9d2706e10af0c0596daeee6a58c9 by Inada Naoki (Zackery Spytz) in branch 'master': bpo-37547: Fix a compiler warning in winconsoleio.c (GH-14785) https://github.com/python/cpython/commit/d3952096537d9d2706e10af0c0596d

[issue36044] PROFILE_TASK for PGO build is not a good workload

2019-07-19 Thread Inada Naoki
Inada Naoki added the comment: >./configure [...] --with-profile-task='-m test --pgo-extended' I think this is abusing of `--with` options. `--with-*` is for external software [1]. But `--with-lto` option abuses it already. How about `./configure PROFILE_TASKS="-m

[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-19 Thread Inada Naoki
Inada Naoki added the comment: I think it's bad idea that suppressing deprecation warning to suppress the warning for deprecated member. It is highly recommended to "not" touching tp_print. Why you want to suppress deprecation warning, not missing field initialisers? You c

[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-19 Thread Inada Naoki
Inada Naoki added the comment: > I am not "touching" tp_print. I am simply defining it as 0 to avoid the > missing initialiser warning. I meant it. `tp_print = 0` touches the deprecated `tp_print` field. It is not forward compatible. Note that we need to re-add tp_print

[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-19 Thread Inada Naoki
Inada Naoki added the comment: > Which is why I protect the initialisation with #if PY_VERSION_HEX < 0x0309 It is your specific case. We can not assume people do it, or even you never forget it. So this is not the "right thing" we can recommend to all users. Once you

[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-19 Thread Inada Naoki
Inada Naoki added the comment: 2019年7月19日(金) 22:00 Phil Thompson : > > If I fail to protect against using a feature when it is no longer > present then it's a bug in my code and it won't compile. Providing a > deprecation warning gives me some notice that my code needs to

[issue30550] Document order-preserving dictionary output in json

2019-07-21 Thread Inada Naoki
Inada Naoki added the comment: OrderedDict is not recommended to preserve order any more. Note that mention about `object_pairs_hook=OrderedDict` is removed intentionally. https://github.com/python/cpython/pull/5001 Please forget about OrderedDict unless you need additional feature

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

2019-07-24 Thread Inada Naoki
Inada Naoki added the comment: New changeset 151b91dfd21a100ecb1eba9e293c0a8695bf3bf5 by Inada Naoki (Jeroen Demeyer) in branch 'master': bpo-29548: deprecate PyEval_Call* functions (GH-14804) https://github.com/python/cpython/commit/151b91dfd21a100ecb1eba9e293c0a

[issue37340] remove free_list for bound method objects

2019-07-24 Thread Inada Naoki
Inada Naoki added the comment: Latest benchmark: ``` $ pyperf compare_to master.json no-freelist.json -G --min-speed=2 Slower (2): - unpickle_list: 4.19 us +- 0.02 us -> 4.28 us +- 0.03 us: 1.02x slower (+2%) - pathlib: 23.2 ms +- 0.2 ms -> 23.7 ms +- 0.3 ms: 1.02x slower (+2%) Fas

[issue37340] remove free_list for bound method objects

2019-07-25 Thread Inada Naoki
Inada Naoki added the comment: New changeset 3e54b575313c64f541e98216ed079fafed01ff5d by Inada Naoki in branch 'master': bpo-37340: remove free_list for bound method objects (GH-14232) https://github.com/python/cpython/commit/3e54b575313c64f541e98216ed079f

[issue37340] remove free_list for bound method objects

2019-07-26 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue37340> ___

[issue36044] PROFILE_TASK for PGO build is not a good workload

2019-07-27 Thread Inada Naoki
Inada Naoki added the comment: @steve.dower Does the PGO have significant benefit for those modules? -- ___ Python tracker <https://bugs.python.org/issue36

[issue37587] JSON loads performance improvement for long strings

2019-07-30 Thread Inada Naoki
Inada Naoki added the comment: Wait... there is no benchmark for the "minimum change". I tested 4 compilers, and provide much better patch in https://bugs.python.org/issue37587#msg348114 -- ___ Python tracker <https://bugs.python.o

[issue37587] JSON loads performance improvement for long strings

2019-07-30 Thread Inada Naoki
Inada Naoki added the comment: Since scope of "c" is very wide, and there is even `&c` in the scope, compiler stores the `c` to stack every time on: c = PyUnicode_READ(kind, buf, next); That is the bottleneck. `if (strict && ...)` is not the bottleneck. My patch us

[issue37587] JSON loads performance improvement for long strings

2019-07-30 Thread Inada Naoki
Inada Naoki added the comment: I tested before, after, Steve's patch, and my patch with gcc 8.3.0 and PGO+LTO. https://gist.github.com/methane/f6077bd1b0b04d40a9c790d9ed670a44#file-gcc-8-3-0-pgo-md Surprisingly, there is no difference. Even my patch didn't help register allocatio

[issue37587] JSON loads performance improvement for long strings

2019-07-30 Thread Inada Naoki
Inada Naoki added the comment: I'm sorry, I was wrong. PGO did very nice job on all cases. gcc allocates `c` to register in the hot loop. -- ___ Python tracker <https://bugs.python.org/is

[issue37587] JSON loads performance improvement for long strings

2019-07-30 Thread Inada Naoki
Inada Naoki added the comment: This issue is very compiler sensitive. Please don't report performance without compiler version and PGO option. Now I'm facing strange behavior. pyperf reports slower time (1ms) for PGO builds, although disasm looks good. But it's 2:30am already.

[issue37729] gc: stats from multi process are mixed up

2019-07-31 Thread Inada Naoki
New submission from Inada Naoki : gc used several PySys_WriteStderr() calls to write stats. This caused stats mixed up when stderr is shared by multiple threads or processes. Attached file (t.py) demonstrates it. Sometimes stats from two processes are mixed up like this: ``` gc: collecting

[issue37729] gc: stats from multi process are mixed up

2019-07-31 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +14801 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15050 ___ Python tracker <https://bugs.python.org/issu

[issue37729] gc: stats from multi process are mixed up

2019-07-31 Thread Inada Naoki
Inada Naoki added the comment: I updated the PR to show "gc: collecting generation 0...\n" before counting objects in each generations. -- ___ Python tracker <https://bugs.python.o

[issue37729] gc: stats from multi process are mixed up

2019-08-01 Thread Inada Naoki
Change by Inada Naoki : -- versions: -Python 3.7 ___ Python tracker <https://bugs.python.org/issue37729> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37729] gc: stats from multi process are mixed up

2019-08-02 Thread Inada Naoki
Inada Naoki added the comment: New changeset bf8162c8c45338470bbe487c8769bba20bde66c2 by Inada Naoki in branch 'master': bpo-37729: gc: write stats at once (GH-15050) https://github.com/python/cpython/commit/bf8162c8c45338470bbe487c8769bb

[issue19692] Rename Py_SAFE_DOWNCAST

2019-08-04 Thread Inada Naoki
Inada Naoki added the comment: While Py_SAFE_DOWNCAST is not documented, it doesn't start with underscore. How many 3rd party code are broken by changing the name? -- nosy: +inada.naoki ___ Python tracker <https://bugs.python.org/is

[issue37729] gc: stats from multi process are mixed up

2019-08-05 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37729] gc: stats from multi process are mixed up

2019-08-05 Thread Inada Naoki
Inada Naoki added the comment: New changeset e8ea34855c7635f8a84b430f17dc01a666f4c0ef by Inada Naoki (Miss Islington (bot)) in branch '3.8': bpo-37729: gc: write stats at once (GH-15050) https://github.com/python/cpython/commit/e8ea34855c7635f8a84b430f17dc01

<    6   7   8   9   10   11   12   13   14   15   >