Message258151
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 |
|
Date |
User |
Action |
Args |
2016-01-13 16:12:34 | vstinner | set | recipients:
+ vstinner, brett.cannon, pitrou |
2016-01-13 16:12:34 | vstinner | set | messageid: <1452701554.57.0.0524257395403.issue26058@psf.upfronthosting.co.za> |
2016-01-13 16:12:34 | vstinner | link | issue26058 messages |
2016-01-13 16:12:34 | vstinner | create | |
|