[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26058] PEP 509: Add ma_version to PyDictObject

2016-05-15 Thread Jakub Stasiak

Changes by Jakub Stasiak :


--
nosy: +jstasiak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 5.3.1-2)]

Patched python: ../pep509/python
3.6.0a0 (default:96f61aab2c6e, Apr 19 2016, 15:21:15) 
[GCC 5.3.1 20151207 (Red Hat 5.3.1-2)]

$ python3 -u perf.py --rigorous -b all ../default.copy/python ../pep509/python

INFO:root:Automatically selected timer: perf_counter
(...)
Report on Linux smithers 4.4.4-301.fc23.x86_64 #1 SMP Fri Mar 4 17:42:42 UTC 
2016 x86_64 x86_64
Total CPU cores: 8

### 2to3 ###
Min: 6.714927 -> 6.856992: 1.02x slower
Avg: 6.726773 -> 6.984359: 1.04x slower
Significant (t=-5.16)
Stddev: 0.01160 -> 0.1: 9.5816x larger

### call_method ###
Min: 0.312567 -> 0.323260: 1.03x slower
Avg: 0.313399 -> 0.323821: 1.03x slower
Significant (t=-284.62)
Stddev: 0.00042 -> 0.00048: 1.1430x larger

### call_simple ###
Min: 0.242091 -> 0.228922: 1.06x faster
Avg: 0.243613 -> 0.229294: 1.06x faster
Significant (t=2134.23)
Stddev: 0.00010 -> 0.5: 1.9124x smaller

### etree_generate ###
Min: 0.255097 -> 0.265558: 1.04x slower
Avg: 0.256947 -> 0.267478: 1.04x slower
Significant (t=-67.89)
Stddev: 0.00111 -> 0.00108: 1.0250x smaller

### etree_parse ###
Min: 0.281726 -> 0.290976: 1.03x slower
Avg: 0.283626 -> 0.292642: 1.03x slower
Significant (t=-62.59)
Stddev: 0.00109 -> 0.00094: 1.1540x smaller

### etree_process ###
Min: 0.217164 -> 0.229552: 1.06x slower
Avg: 0.219401 -> 0.231242: 1.05x slower
Significant (t=-75.05)
Stddev: 0.00112 -> 0.00111: 1.0053x smaller

### fannkuch ###
Min: 1.012875 -> 0.985196: 1.03x faster
Avg: 1.014760 -> 0.992104: 1.02x faster
Significant (t=46.44)
Stddev: 0.00287 -> 0.00395: 1.3778x larger

### float ###
Min: 0.259226 -> 0.251918: 1.03x faster
Avg: 0.266530 -> 0.260176: 1.02x faster
Significant (t=10.69)
Stddev: 0.00403 -> 0.00437: 1.0836x larger

### json_load ###
Min: 0.430602 -> 0.433593: 1.01x slower
Avg: 0.431278 -> 0.486924: 1.13x slower
Significant (t=-24.86)
Stddev: 0.00045 -> 0.02238: 49.8974x larger

### normal_startup ###
Min: 0.319092 -> 0.326082: 1.02x slower
Avg: 0.320093 -> 0.326842: 1.02x slower
Significant (t=-70.52)
Stddev: 0.00067 -> 0.00069: 1.0283x larger

### regex_effbot ###
Min: 0.048969 -> 0.048313: 1.01x faster
Avg: 0.050019 -> 0.048415: 1.03x faster
Significant (t=31.41)
Stddev: 0.00051 -> 0.6: 8.8152x smaller

### regex_v8 ###
Min: 0.051040 -> 0.043412: 1.18x faster
Avg: 0.051325 -> 0.043577: 1.18x faster
Significant (t=45.60)
Stddev: 0.00120 -> 0.00120: 1.0013x larger

### richards ###
Min: 0.157625 -> 0.161126: 1.02x slower
Avg: 0.158952 -> 0.162519: 1.02x slower
Significant (t=-34.92)
Stddev: 0.00073 -> 0.00071: 1.0351x smaller

### silent_logging ###
Min: 0.070547 -> 0.069902: 1.01x faster
Avg: 0.072246 -> 0.069934: 1.03x faster
Significant (t=65.51)
Stddev: 0.00035 -> 0.3: 11.9828x smaller

The following not significant results are hidden, use -v to show them:
call_method_slots, call_method_unknown, chameleon_v2, chaos, django_v3, 
etree_iterparse, fastpickle, fastunpickle, formatted_logging, go, hexiom2, 
json_dump_v2, mako_v2, meteor_contest, nbody, nqueens, pathlib, pickle_dict, 
pickle_list, pidigits, raytrace, regex_compile, simple_logging, spectral_norm, 
startup_nosite, telco, tornado_http, unpack_sequence, unpickle_list.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 you
can do about those slowdowns.

> 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 without the patch.
> 
> python3.6 -m timeit 'd={}; d[1]=1; d[2]=2; d[3]=3; d[4]=4; d[5]=5;
> d[6]=6; d[7]=7; d[8]=8; d[9]=9; d[10]=10' says 838 ns with and without
> the patch.
> 
> I have to "cheat": I run timeit enough times until I see the "minimum".

Those operations are too fast for timeit. The overhead associated
with looping is much larger than the time it takes to run the
operation itself. That's why in pybench I put the operations into
blocks of repeated statements. The interpreter then doesn't spend
time on branching when going from one statement execution to the
next (inside those blocks) and you get closer to the real runtime
of the operation you're trying to measure.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 without the patch.

python3.6 -m timeit 'd={}; d[1]=1; d[2]=2; d[3]=3; d[4]=4; d[5]=5;
d[6]=6; d[7]=7; d[8]=8; d[9]=9; d[10]=10' says 838 ns with and without
the patch.

I have to "cheat": I run timeit enough times until I see the "minimum".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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...

This can easily happen as a result of different memory layout, but is
very much dependent on the machine architecture, CPU, memory type, etc.

> Dict microbenchmarks:
> 
>DictCreation:38ms36ms   +4.8%39ms37ms   +3.9%
>   DictWithFloatKeys:40ms40ms   -0.8%40ms40ms   -0.4%
> DictWithIntegerKeys:33ms31ms   +7.2%33ms31ms   +7.6%
>  DictWithStringKeys:29ms28ms   +0.4%29ms29ms   +0.7%
>  SimpleDictManipulation:59ms59ms   -0.4%59ms59ms   -0.4%

Only dict creation and the integer keys benchmark results are relevant.

Could you perhaps check what's causing these slowdowns ?

--
nosy: +lemburg

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 *faster*, 
whereas some benchmarks are faster with the patch...

Dict microbenchmarks:

   DictCreation:38ms36ms   +4.8%39ms37ms   +3.9%
  DictWithFloatKeys:40ms40ms   -0.8%40ms40ms   -0.4%
DictWithIntegerKeys:33ms31ms   +7.2%33ms31ms   +7.6%
 DictWithStringKeys:29ms28ms   +0.4%29ms29ms   +0.7%
 SimpleDictManipulation:59ms59ms   -0.4%59ms59ms   -0.4%

Full output:

$ ./python.version Tools/pybench/pybench.py -f pybench.version
$ ./python.orig Tools/pybench/pybench.py -f pybench.orig
$ ./python.orig Tools/pybench/pybench.py -s pybench.version -c pybench.orig 

---
PYBENCH 2.1
---
* using CPython 3.6.0a0 (default:e281a57d5b29, Apr 19 2016, 12:30:36) [GCC 
5.3.1 20151207 (Red Hat 5.3.1-2)]
* disabled garbage collection
* system check interval set to maximum: 2147483647
* using timer: time.perf_counter
* timer: resolution=1e-09, implementation=clock_gettime(CLOCK_MONOTONIC)

---
Benchmark: pybench.version
---

Rounds: 10
Warp:   10
Timer:  time.perf_counter

Machine Details:
   Platform ID:
Linux-4.4.4-301.fc23.x86_64-x86_64-with-fedora-23-Twenty_Three
   Processor:  x86_64

Python:
   Implementation: CPython
   Executable: /home/haypo/prog/python/default/python.version
   Version:3.6.0a0
   Compiler:   GCC 5.3.1 20151207 (Red Hat 5.3.1-2)
   Bits:   64bit
   Build:  Apr 19 2016 12:29:16 (#default:e281a57d5b29+)
   Unicode:UCS4


---
Comparing with: pybench.orig
---

Rounds: 10
Warp:   10
Timer:  time.perf_counter

Machine Details:
   Platform ID:
Linux-4.4.4-301.fc23.x86_64-x86_64-with-fedora-23-Twenty_Three
   Processor:  x86_64

Python:
   Implementation: CPython
   Executable: /home/haypo/prog/python/default/python.orig
   Version:3.6.0a0
   Compiler:   GCC 5.3.1 20151207 (Red Hat 5.3.1-2)
   Bits:   64bit
   Build:  Apr 19 2016 12:30:36 (#default:e281a57d5b29)
   Unicode:UCS4


Test minimum run-timeaverage  run-time
 thisother   diffthisother   diff
---
  BuiltinFunctionCalls:49ms50ms   -1.3%49ms50ms   -1.2%
   BuiltinMethodLookup:26ms26ms   -0.8%26ms27ms   -1.2%
 CompareFloats:29ms30ms   -2.0%29ms30ms   -1.9%
 CompareFloatsIntegers:39ms39ms   +1.4%39ms39ms   +1.5%
   CompareIntegers:43ms43ms   -1.1%43ms43ms   -1.1%
CompareInternedStrings:28ms28ms   -0.2%28ms28ms   -0.3%
  CompareLongs:25ms25ms   +2.8%25ms25ms   +2.9%
CompareStrings:26ms27ms   -0.8%26ms27ms   -1.6%
ComplexPythonFunctionCalls:44ms44ms   -1.6%44ms45ms   -1.6%
 ConcatStrings:35ms33ms   +6.4%35ms33ms   +6.1%
   CreateInstances:49ms48ms   +2.6%50ms49ms   +1.8%
CreateNewInstances:37ms36ms   +2.5%37ms36ms   +2.2%
   CreateStringsWithConcat:65ms63ms   +3.3%66ms64ms   +2.9%
  DictCreation:38ms36ms   +4.8%39ms37ms   +3.9%
 DictWithFloatKeys:40ms40ms   -0.8%40ms40ms   -0.4%
   DictWithIntegerKeys:33ms31ms   +7.2%33ms31ms   +7.6%
DictWithStringKeys:29ms28ms   +0.4%29ms29ms   +0.7%
  ForLoops:25ms25ms   -0.4%26ms26ms   -0.3%
IfThenElse:37ms35ms   +3.3%37ms36ms   +3.0%
   ListSlicing:39ms38ms   +0.3%39ms39ms   +0.0%
NestedForLoops:40ms40ms   +0.1%40ms40ms   -0.0%
  NestedListComprehensions:41ms42ms   -0.2%42ms42ms   -0.9%
  NormalClassAttribute:82ms78ms   +4.0%82ms79ms   +3.8%
   NormalInstanceAttribute:43ms42ms   

[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 range(2**16)}' 'for i in range(2**16): d[i]=i-1' 
'for i in range(2**16): d[i]=i+1' 'for i in range(2**15): del d[i]' 'd.clear()'

* Original: 21.2 msec
* Version: 21.4 msec (+0.2 ms, +0.9%)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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; d[3]=0; d[4]=0; del d[1]; del 
d[2]; d.clear()'
100 loops, best of 3: 0.293 usec per loop

=> 1 nanosecond (0.3%) slower

$ ./python.orig -m timeit 'd={i:i for i in range(2**16)}' 'for i in 
range(2**16): d[i]=i-1' 'for i in range(2**16): d[i]=i+1' 'for i in 
range(2**15): del d[i]' 'd.clear()'
10 loops, best of 3: 21.2 msec per loop
$ ./python.version -m timeit 'd={i:i for i in range(2**16)}' 'for i in 
range(2**16): d[i]=i-1' 'for i in range(2**16): d[i]=i+1' 'for i in 
range(2**15): del d[i]' 'd.clear()'
10 loops, best of 3: 21.3 msec per loop

=> 0.1 ms (0.5%) slower

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 tests on identical values
* Add new unit tests on equal values (with special __eq__ method)

--
Added file: http://bugs.python.org/file42518/dict_version-8.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: http://bugs.python.org/file42476/dict_version-7.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 can choose to not implement it.

--
Added file: http://bugs.python.org/file41701/dict_version-6.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 cannot have the same 
version. So if a guard stores a version, the check on the version will fail if 
a different dictionary is used.

--
Added file: http://bugs.python.org/file41691/dict_version-5.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26058] PEP 509: Add ma_version to PyDictObject

2016-01-14 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy: +yselivanov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 -n 25
./python.patched Tools/pybench/pybench.py -f pybench.dictver -w 2 -C 100 -n 25
./python Tools/pybench/pybench.py -s pybench.dictver -c pybench.orig

---
PYBENCH 2.1
---
* using CPython 3.6.0a0 (default:77d24f51effc+, Jan 13 2016, 11:27:53) [GCC 
5.3.1 20151207 (Red Hat 5.3.1-2)]
* disabled garbage collection
* system check interval set to maximum: 2147483647
* using timer: time.perf_counter
* timer: resolution=1e-09, implementation=clock_gettime(CLOCK_MONOTONIC)

---
Benchmark: pybench.dictver
---

Rounds: 25
Warp:   2
Timer:  time.perf_counter

Machine Details:
   Platform ID:
Linux-4.2.8-300.fc23.x86_64-x86_64-with-fedora-23-Twenty_Three
   Processor:  x86_64

Python:
   Implementation: CPython
   Executable: /home/haypo/prog/python/default/python
   Version:3.6.0a0
   Compiler:   GCC 5.3.1 20151207 (Red Hat 5.3.1-2)
   Bits:   64bit
   Build:  Jan 13 2016 11:27:53 (#default:77d24f51effc+)
   Unicode:UCS4


---
Comparing with: pybench.orig
---

Rounds: 25
Warp:   2
Timer:  time.perf_counter

Machine Details:
   Platform ID:
Linux-4.2.8-300.fc23.x86_64-x86_64-with-fedora-23-Twenty_Three
   Processor:  x86_64

Python:
   Implementation: CPython
   Executable: /home/haypo/prog/python/default/python
   Version:3.6.0a0
   Compiler:   GCC 5.3.1 20151207 (Red Hat 5.3.1-2)
   Bits:   64bit
   Build:  Jan 13 2016 11:14:50 (#default:77d24f51effc)
   Unicode:UCS4


Test minimum run-timeaverage  run-time
 thisother   diffthisother   diff
---
  BuiltinFunctionCalls:   230ms   229ms   +0.4%   241ms   230ms   +5.1%
   BuiltinMethodLookup:   130ms   132ms   -1.2%   135ms   134ms   +0.4%
 CompareFloats:   147ms   149ms   -1.4%   151ms   149ms   +1.2%
 CompareFloatsIntegers:   330ms   333ms   -0.8%   347ms   335ms   +3.6%
   CompareIntegers:   214ms   209ms   +2.5%   223ms   209ms   +6.5%
CompareInternedStrings:   160ms   145ms  +10.8%   170ms   145ms  +16.9%
  CompareLongs:   121ms   120ms   +0.2%   124ms   120ms   +3.4%
CompareStrings:   132ms   131ms   +0.7%   138ms   132ms   +4.8%
ComplexPythonFunctionCalls:   233ms   235ms   -0.7%   241ms   238ms   +1.1%
 ConcatStrings:   166ms   165ms   +0.3%   177ms   167ms   +6.0%
   CreateInstances:   240ms   247ms   -3.1%   253ms   249ms   +1.5%
CreateNewInstances:   178ms   186ms   -4.2%   188ms   188ms   +0.1%
   CreateStringsWithConcat:   315ms   316ms   -0.5%   331ms   318ms   +4.3%
  DictCreation:   254ms   236ms   +7.8%   262ms   237ms  +10.5%
 DictWithFloatKeys:   211ms   199ms   +6.1%   219ms   201ms   +8.9%
   DictWithIntegerKeys:   171ms   163ms   +5.4%   180ms   166ms   +9.0%
DictWithStringKeys:   163ms   142ms  +14.5%   170ms   144ms  +17.7%
  ForLoops:   121ms   121ms   -0.3%   125ms   124ms   +0.9%
IfThenElse:   179ms   178ms   +0.7%   185ms   178ms   +3.6%
   ListSlicing:   194ms   193ms   +0.4%   198ms   194ms   +2.2%
NestedForLoops:   212ms   210ms   +1.2%   220ms   210ms   +4.6%
  NestedListComprehensions:   205ms   212ms   -3.3%   218ms   215ms   +1.5%
  NormalClassAttribute:   429ms   407ms   +5.5%   446ms   408ms   +9.3%
   NormalInstanceAttribute:   212ms   206ms   +2.8%   226ms   209ms   +8.0%
   PythonFunctionCalls:   208ms   210ms   -1.4%   215ms   212ms   +1.2%
 PythonMethodCalls:   275ms   253ms   +8.7%   293ms   255ms  +14.9%
 Recursion:   333ms   328ms   +1.4%   366ms   329ms  +11.0%
  SecondImport:   190ms   188ms   +0.8%   201ms   188ms   +6.7%
   SecondPackageImport:   195ms   192ms   +1.8%   214ms   192ms  +11.7%
 SecondSubmoduleImport:   472ms   447ms   +5.7%   502ms   455ms  +10.3%
   

[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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:

* PyObject_GetItem(): 10.2 ns
* PyDict_GetItem(): 9.1 ns
* guard->check(): 2.9 ns

python3 -m platform:
Linux-4.2.8-300.fc23.x86_64-x86_64-with-fedora-23-Twenty_Three

You have to modify manually _testcapi.c to choose between the 3 implementations.

guard_benchmark.patch requires the issue #26098 patch and the fat module which 
implements fat.GuardDict. The fat module can be found at:
https://github.com/haypo/fat

--
Added file: http://bugs.python.org/file41604/guard_benchmark.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 file: http://bugs.python.org/file41581/dict_version-3.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com