[issue26058] PEP 509: Add ma_version to PyDictObject

2016-09-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset c3776dd858f0 by Victor Stinner in branch 'default': Try to fix sizeof unit tests on dict https://hg.python.org/cpython/rev/c3776dd858f0 -- ___ Python tracker

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-09-08 Thread STINNER Victor
STINNER Victor added the comment: The PEP 509 has been approved by Guido, I just pushed the implementation. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-09-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset d43f819caea7 by Victor Stinner in branch 'default': Add a new private version to the builtin dict type https://hg.python.org/cpython/rev/d43f819caea7 -- nosy: +python-dev ___ Python tracker

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-05-15 Thread Jakub Stasiak
Changes by Jakub Stasiak : -- nosy: +jstasiak ___ Python tracker ___ ___

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-04-19 Thread STINNER Victor
STINNER Victor added the comment: Results of the CPython benchmark suite on dict_version-8.patch. IMHO regex_v8 can be ignored, this benchmark is unstable (issue #26275). Original python: ../pep509/python 3.6.0a0 (default:3a9b47b062b9, Apr 19 2016, 16:23:15) [GCC 5.3.1 20151207 (Red Hat

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-04-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 19.04.2016 13:11, STINNER Victor wrote: > > STINNER Victor added the comment: > >> Could you perhaps check what's causing these slowdowns ? > > It's obvious, no? My patch causes the slowdown. Well, yes, of course :-) I meant whether there's anything

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-04-19 Thread STINNER Victor
STINNER Victor added the comment: > Could you perhaps check what's causing these slowdowns ? It's obvious, no? My patch causes the slowdown. On a timeit microbenchmark, I don't see such slowdown. That's also why I suspect that pybench is unstable. python3.6 -m timeit '{}' says 105 ns with and

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-04-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 19.04.2016 12:52, STINNER Victor wrote: > > As usual, I'm very skeptical on the pybench results which almost look like > noise. I don't understand how my change can make any operation *faster*, > whereas some benchmarks are faster with the patch...

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-04-19 Thread STINNER Victor
STINNER Victor added the comment: pybench results on dict_version-8.patch with CPU isolation: http://haypo-notes.readthedocs.org/microbenchmark.html As usual, I'm very skeptical on the pybench results which almost look like noise. I don't understand how my change can make any operation

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-04-19 Thread STINNER Victor
STINNER Victor added the comment: I ran again timeit microbenchmarks with CPU isolation on dict_version-8.patch, minimum of 10 runs. -m timeit 'd={1: 0}; d[2]=0; d[3]=0; d[4]=0; del d[1]; del d[2]; d.clear()' * Original: 287 ns * Version: 289 ns (+2 ns, +0.7%) -m timeit 'd={i:i for i in

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-04-19 Thread STINNER Victor
STINNER Victor added the comment: timeit microbenchmarks on dict_version-8.patch, minimum of 10 runs. $ ./python.orig -m timeit 'd={1: 0}; d[2]=0; d[3]=0; d[4]=0; del d[1]; del d[2]; d.clear()' 100 loops, best of 3: 0.292 usec per loop $ ./python.version -m timeit 'd={1: 0}; d[2]=0;

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-04-19 Thread STINNER Victor
STINNER Victor added the comment: Patch version 8: * Update to the latest PEP: remove micro-optimization in dictobject.c if the new value is identical to the current value, dict.__setitem__() now always changes the version * Refactor test_pep509 to address Brett's comments * Add new unit

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-04-15 Thread STINNER Victor
STINNER Victor added the comment: > The implementation is outdated: ma_version was renamed to ma_version_tag in > the latest version of the PEP 509. Patch version 7 is updated to the latest PEP (rebased and rename ma_version to ma_version_tag). -- Added file:

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-04-14 Thread STINNER Victor
STINNER Victor added the comment: The implementation is outdated: ma_version was renamed to ma_version_tag in the latest version of the PEP 509. -- ___ Python tracker

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-23 Thread STINNER Victor
STINNER Victor added the comment: Patch version 6: remove now unused function _testcapi.dict_set_version(). I also moved tests to test_pep509.py to make it more explicit that the implementation of the PEP 509 is not part the Python dictionary type specification, other Python implementations

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-22 Thread Yury Selivanov
Yury Selivanov added the comment: > Patch version 5: a global counter is now used to set ma_version field of > dictionaries. The global counter is incremented each time that a dictionary > is created and each time that a dictionary is modified. This is great, thank you, Victor. --

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-22 Thread STINNER Victor
STINNER Victor added the comment: > This is great, thank you, Victor. I will update the PEP 509 later for the global counter. -- ___ Python tracker ___

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-22 Thread STINNER Victor
STINNER Victor added the comment: Patch version 5: a global counter is now used to set ma_version field of dictionaries. The global counter is incremented each time that a dictionary is created and each time that a dictionary is modified. A dictionary version is now unique: two dictionaries

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-18 Thread R. David Murray
Changes by R. David Murray : -- nosy: +r.david.murray ___ Python tracker ___ ___

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-14 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker ___ ___

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-13 Thread STINNER Victor
STINNER Victor added the comment: I'm not a big fan of pybench (it looks unstable and so not reliable), but here are results with dict_version-4.patch. I used more loops and a lower warp factor to get more reliable tests (I hope): ./python Tools/pybench/pybench.py -f pybench.orig -w 2 -C 100

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-13 Thread STINNER Victor
STINNER Victor added the comment: Patch version 4: I forgot to include my patch to update test_sys. Now the full Python test suite pass. -- Added file: http://bugs.python.org/file41599/dict_version-4.patch ___ Python tracker

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-13 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file41605/guard_benchmark.py ___ Python tracker ___

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-13 Thread STINNER Victor
STINNER Victor added the comment: guard_benchmark.patch: patch adding a _testcapi.guard_benchmark(), a microbenchmark on dictionary guard. The benchmark measures the cost of checking if a dictionary key was modified. Run the benchmark with attached guard_benchmark.py. Result on my PC: *

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-11 Thread STINNER Victor
STINNER Victor added the comment: Patch version 3 updated for the second version of the PEP 509. Main changes: * ma_version now has the type PY_UINT64_T * remove dict.__version__ property: replace with _testcapi.dict_get_version() for tests -- versions: +Python 3.6 -Python 2.7 Added

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-11 Thread STINNER Victor
STINNER Victor added the comment: The PEP is now at python.org: PEP 509. -- ___ Python tracker ___ ___

[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-11 Thread STINNER Victor
Changes by STINNER Victor : -- title: Add dict.__version__ read-only property -> PEP 509: Add ma_version to PyDictObject ___ Python tracker