Eric Olson added the comment:
The performance is still an issue in python 3.
Attaching a patch for python 3, performance numbers are below.
Measuring ndbm time for a falsey check on an open db with 100 entries. gdbm
performance is similar.
Before patch:
db is not None: 6.9141387939453125e-06
not db: 0.0006985664367675781
Factor: 101X (slow)
After patch:
db is not None: 4.76837158203125e-06
not db: 4.0531158447265625e-06
Factor: 1X (expected)
Also, added a couple tests to verify bool(db) returns the correct value.
----------
nosy: +eolson
Added file: http://bugs.python.org/file34879/dbm_bool.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue2159>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com