Message218441
Right, my benchmark was indeed flawed. Here are the new results on my machine:
Without the patch
# ./python -S -m timeit -n 100000 -s "import dbm.dumb as dbm; d=dbm.open('x.dat', 'c')" "len(d)"
100000 loops, best of 3: 0.564 usec per loop
With the patch
# ./python -S -m timeit -n 100000 -s "import dbm.dumb as dbm; d=dbm.open('x.dat', 'c')" "len(d)"
100000 loops, best of 3: 0.857 usec per loop
Even having an empty _verify_open in __len__ method leads to this:
# ./python -S -m timeit -n 100000 -s "import dbm.dumb as dbm; d=dbm.open('x.dat', 'c')" "len(d)"
100000 loops, best of 3: 0.749 usec per loop |
|
Date |
User |
Action |
Args |
2014-05-13 11:42:40 | Claudiu.Popa | set | recipients:
+ Claudiu.Popa, ncoghlan, Arfrever, python-dev, Jim.Jewett, serhiy.storchaka |
2014-05-13 11:42:39 | Claudiu.Popa | set | messageid: <1399981359.87.0.906212525771.issue19385@psf.upfronthosting.co.za> |
2014-05-13 11:42:39 | Claudiu.Popa | link | issue19385 messages |
2014-05-13 11:42:39 | Claudiu.Popa | create | |
|