This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients brett.cannon, pitrou, vstinner
Date 2016-01-13.16:12:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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 Result on my PC:

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

python3 -m platform:

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:
Date User Action Args
2016-01-13 16:12:34vstinnersetrecipients: + vstinner, brett.cannon, pitrou
2016-01-13 16:12:34vstinnersetmessageid: <>
2016-01-13 16:12:34vstinnerlinkissue26058 messages
2016-01-13 16:12:34vstinnercreate