[issue26058] Add dict.__version__ read-only property

2016-01-09 Thread Brett Cannon
Brett Cannon added the comment: So min is the fastest time in a benchmark execution, average is the average across all benchmark executions, and the t-value is some statistics thing. Anything marked insignificant had such a small average difference it isn't worth reporting. If you want to smo

[issue26058] Add dict.__version__ read-only property

2016-01-09 Thread STINNER Victor
STINNER Victor added the comment: Brett: > A better way to benchmark this is to run hg.python.org/benchmarks with a > patched interpreter and see if that shows any performance impact. Ok. Here is the output. Can you please explain me the result? :-) Especially the "significant" value. $ ./py

[issue26058] Add dict.__version__ read-only property

2016-01-09 Thread Brett Cannon
Brett Cannon added the comment: A better way to benchmark this is to run hg.python.org/benchmarks with a patched interpreter and see if that shows any performance impact. -- nosy: +brett.cannon ___ Python tracker

[issue26058] Add dict.__version__ read-only property

2016-01-09 Thread STINNER Victor
STINNER Victor added the comment: > I don't understand this: >> The version 0 is reserved for "missing key" Oh, ignore it, it's an outdated comment :-) Dictionary version is initialized to 0, it's not more "reserved". FYI I added the comment in my first implementation which also added a versio

[issue26058] Add dict.__version__ read-only property

2016-01-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't understand this: > The version 0 is reserved for "missing key" -- nosy: +pitrou ___ Python tracker ___

[issue26058] Add dict.__version__ read-only property

2016-01-09 Thread STINNER Victor
STINNER Victor added the comment: Updated patch, I forgot to include unit tests. I added a test on integer overflow on the version. The patch adds _testcapi.dict_setversion(dict, version) and _testcapi.PY_SIZE_MAX. -- Added file: http://bugs.python.org/file41547/dict_version-2.patch _

[issue26058] Add dict.__version__ read-only property

2016-01-09 Thread STINNER Victor
STINNER Victor added the comment: Using timeit to microbenchmark dict operations (constructor, __setitem__, __delitem__, clear), I get exactly the same performance or even better performance (???) with the patch. ./python -m timeit 'd={1: 0}; d[2]=0; d[3]=0; d[4]=0; del d[1]; del d[2]; d.clea

[issue26058] Add dict.__version__ read-only property

2016-01-09 Thread STINNER Victor
STINNER Victor added the comment: Result of pybench on Dict microbenchmarks: DictCreation:44ms49ms -10.5%44ms49ms -10.7% DictWithFloatKeys:35ms35ms -0.5%35ms35ms -1.0% DictWithIntegerKeys:28ms28ms -1.2%

[issue26058] Add dict.__version__ read-only property

2016-01-09 Thread STINNER Victor
New submission from STINNER Victor: Attached patch implements the following PEP currently discussed on python-ideas: https://faster-cpython.readthedocs.org/pep_dict_version.html#pep-dict-version -- files: dict_version.patch keywords: patch messages: 257809 nosy: haypo priority: normal se