INADA Naoki added the comment:
Traceback tells:
#22 0x005a52db in PyInterpreterState_Clear (interp=0x95ac80) at
../Python/pystate.c:111
Py_CLEAR(interp->sysdict);
While cleaning up interp->sysdict...
#19 0x004d86c6 in tb_dealloc.46270 (tb=0x7f0aa1278f38) at
../
INADA Naoki added the comment:
> I don't understand well the effect of the hot attribute
I compared lookdict_unicode_nodummy assembly by `objdump -d dictobject.o`.
It looks completely same.
So I think only difference is placement. hot functions are in .text.hot section
and linker
gr
INADA Naoki added the comment:
> so I suggest to run benchmarks and check that it has a non negligible effect
> on benchmarks ;-)
When added _Py_HOT_FUNCTION to lookdict_unicode, lookdict_unicode_nodummy and
lookdict_split
(I can't measure L1 miss via `perf stat -d` because I
INADA Naoki added the comment:
Can you check backtrace of main thread?
--
___
Python tracker
<http://bugs.python.org/issue28673>
___
___
Python-bugs-list mailin
INADA Naoki added the comment:
Patch LGTM.
But I don't know it's OK to commit it on 2.7, 3.5 and 3.6.
--
nosy: +inada.naoki
___
Python tracker
<http://bugs.python.o
INADA Naoki added the comment:
0001-Issue-27945-fix-PyDict_MergeFromSeq2-use-after-free.patch:
LGTM. I've checked it can be applied to 2.7 and 3.5 branch and passes
`make quicktest`.
--
___
Python tracker
<http://bugs.python.org/is
INADA Naoki added the comment:
0001-Issue-27945-fix-dictitems_contains-use-after-free.patch
LGTM.
This patch can be applied to 2.7 and 3.5, without conflict against previous
patch.
It passes `make quicktest`.
--
___
Python tracker
<h
INADA Naoki added the comment:
0001-Issue-27945-fix-dictiter_iternextitem-use-after-free.patch LGTM and OK too.
But 0001-Issue-27945-Fixed-segfaults-in-dict.fromkeys-when-it.patch cause
conflict.
I want to commit first three patches.
For another reviewer, here is the patch merging three
INADA Naoki added the comment:
OK, I'll run benchmark in this week.
But three patches seems don't affects to performance critical APIs.
--
___
Python tracker
<http://bugs.python.o
INADA Naoki added the comment:
I run performance 0.5.0 on Python 3.5.
Since it took long time even without -b all option, I haven't run it for Python
2.7 yet.
On Python 3.5:
$ ./venv/cpython3.5-846d5b1f0b61/bin/python -m perf compare_to py35-master.json
py35-patched.json -G
Slowe
INADA Naoki added the comment:
Only patch which affects to hot loop is:
--- a/Objects/dictobject.c Tue Nov 15 21:21:35 2016 -0500
+++ b/Objects/dictobject.c Wed Nov 16 11:40:51 2016 +
@@ -1550,11 +1550,18 @@ PyDict_MergeFromSeq2(PyObject *d, PyObje
/* Update/merge with
INADA Naoki added the comment:
I'm sorry, dict.fromkeys() didn't use PyDict_MergeFromSeq2().
This may be microbench for worst case:
$ ~/local/py35/bin/master -m perf timeit --rigorous --python
~/local/py35/bin/patched --compare-to ~/local/py35/bin/master -s 'L = [(i,i)
for i
INADA Naoki added the comment:
I modified the patch to avoid incref&decref when pair is not list, because
tuple is common for such case.
But I can't get back original performance.
(python 2.7 is modified version of patch)
inada-n@test1:~/work/bench$ ~/local/py27/bin/master -m pe
INADA Naoki added the comment:
FYI, multiprocessing.reduction module has send_fds and recv_fds.
--
nosy: +inada.naoki
___
Python tracker
<http://bugs.python.org/issue28
New submission from INADA Naoki:
_PyDict_NewPresized(6) creates dict which keysize is 8.
But it's capacity is 5 (8 * 2 // 3 = 5).
This internal API is used by BUILD_MAP and BUILD_CONST_KEYMAP.
--
assignee: inada.naoki
files: PyDict_NewPresized-too-small.patch
keywords: patch
mes
INADA Naoki added the comment:
This patch includes fix for ESTIMATE_SIZE macro. (see below)
Same fix is included in patch for issue28147.
>>> def estimate_size(n):
... return n * 3 // 2 # Current ESTIMATE_SIZE
...
>>> def usable(n):
... return n * 2 // 3
...
>&
INADA Naoki added the comment:
current:
$ ~/work/python36/bin/python3 -m perf timeit -- 'd = {"a":1, "b":2, "c":3,
"d":4, "e":5, "f":6}'
.
Median +- std dev: 925 ns +- 49 ns
patched:
$ ~/work/python36/
INADA Naoki added the comment:
inada-n@test1:~/work/py36$ ~/local/py36/bin/patched -m perf timeit --compare-to
~/local/py36/bin/master -- 'd = {"a":1, "b":2, "c":3, "d":4, "e":5, "f":6}'
master: . 910 ns
INADA Naoki added the comment:
Python 3.5 has similar issue:
$ ~/local/py35/bin/patched -m perf timeit --compare-to ~/local/py35/bin/master
-- 'd = {"a":1, "b":2, "c":3, "d":4, "e":5, "f":6}'
master: . 1.1
INADA Naoki added the comment:
On Fri, Nov 18, 2016 at 9:31 PM, Serhiy Storchaka
wrote:
>
> Serhiy Storchaka added the comment:
>
> The condition in the loop in _PyDict_NewPresized() contains the test newsize
> > 0. This is a check for integer overflow. But it doesn't ma
INADA Naoki added the comment:
Can I assume PY_SSIZE_T_MAX is 2**n-1?
If so, I can define like:
#define PyDict_MAXSIZE (PY_SSIZE_T/8+1)
--
___
Python tracker
<http://bugs.python.org/issue28
INADA Naoki added the comment:
> This optimization affects only 6-element (and perhaps to less extend
> 11-element) dicts. But in any case this is good enhancement.
This affects when minused = (n*2/3)+1 .. n-1 (n=8, 16, ...)
n=8: 6, 7
n=16: 11, 12, ..15
> Naoki, could you pl
INADA Naoki added the comment:
LGTM.
Performance on Azure VM (AMD Opteron(tm) Processor 4171 HE):
$ ~/local/py36/bin/patched -m perf compare_to master.json patched.json -G
Slower (10):
- spectral_norm: 915 ms +- 17 ms -> 967 ms +- 25 ms: 1.06x slower
- nbody: 774 ms +- 28 ms -> 805 ms +-
INADA Naoki added the comment:
> If someone comes forward with more fully formed idea for code generation or
> overall structural enchancement, that can be put in another tracker item.
I noticed argument clinic supports Python [1]. So there is one way to code
generation already.
At
INADA Naoki added the comment:
Updated patch: fixed small issue in argument clinic, and added
comment why we use code generation.
--
Added file: http://bugs.python.org/file45580/namedtuple-clinic2.diff
___
Python tracker
<http://bugs.python.
INADA Naoki added the comment:
I noticed today is code freeze for final beta.
Is this too late for 3.6.0?
--
priority: normal -> high
___
Python tracker
<http://bugs.python.org/issu
INADA Naoki added the comment:
ping
--
___
Python tracker
<http://bugs.python.org/issue28023>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Changes by INADA Naoki :
Added file:
http://bugs.python.org/file45583/28731-PyDict_NewPresized-too-small-2.patch
___
Python tracker
<http://bugs.python.org/issue28
INADA Naoki added the comment:
Thanks for review.
Since doc update is allowed after final beta, I committed
verbose-version3.patch for now.
Here is patch for doc.
--
Added file: http://bugs.python.org/file45585/vervose-version-doc.patch
___
Python
Changes by INADA Naoki :
Added file:
http://bugs.python.org/file45586/28731-PyDict_NewPresized-too-small-3.patch
___
Python tracker
<http://bugs.python.org/issue28
INADA Naoki added the comment:
OK. I've updated the patch.
BTW, I used const Py_ssize_t for function local constant.
Should I use file scope macro for such heuristic threshold, even it
is used only one function?
--
priority: high ->
Changes by INADA Naoki :
Added file: http://bugs.python.org/file45589/dict_gdb2.patch
___
Python tracker
<http://bugs.python.org/issue28023>
___
___
Python-bugs-list m
INADA Naoki added the comment:
Thanks.
As @haypo suggests, I'll commit this to default branch first, and
backport to 3.6 after 3.6.0 is released.
--
___
Python tracker
<http://bugs.python.org/is
INADA Naoki added the comment:
I added ``-VV`` option to python command (issue28532).
Which section should I add the entry about it?
--
nosy: +inada.naoki
___
Python tracker
<http://bugs.python.org/issue28
INADA Naoki added the comment:
https://mail.python.org/pipermail/python-committers/2016-November/004065.html
> The 3.6 branch in the cpython repo is now available again but, as noted,
> *only* for reviewed release critical fixes appropriate for the 3.6.0 final
> and for final 3.6.0 do
Changes by INADA Naoki :
--
resolution: -> fixed
stage: commit review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
INADA Naoki added the comment:
Wow. It's sad that tagged version is accidentally slow...
I want to reproduce it and check `perf record -e L1-icache-load-misses`.
But IaaS (EC2, GCE, Azure VM) doesn't support CPU performance counter.
--
INADA Naoki added the comment:
I setup Ubuntu 14.04 on Azure, built python without neither PGO nor LTO.
But I failed to reproduce it.
@haypo, would you give me two binaries?
$ ~/local/py-2a143/bin/python3 -c 'import sys; print(sys.version)'
3.7.0a0 (default:2a14385710dc, Nov 22 2016
INADA Naoki added the comment:
Thanks a lot!
I hope I can run test on multiple environment before merge,
after we move to Github.
--
___
Python tracker
<http://bugs.python.org/issue28
3001 - 3039 of 3039 matches
Mail list logo