3 ms·
According to his benchmark run today on Python 3.9 on linux, dbm is still considerably faster for random access. That said, what database dbm is using varies a
by calpaterson 4y ago
According to his benchmark run today on Python 3.9 on linux, dbm is still considerably faster for random access.
That said, what database dbm is using varies a lot by platform. I think on linux it's usually BerkleyDB.
I use dbm a lot to cache pickles of object that were slow to create. eg pandas dataframes
- curiousgal 4y agoSorry if it's a dumb question but sinc dbm writes stuff to disk, how is that different than loading the pickles?
- dfox 4y agoYou get one file for the whole store, not one per key. Also, it tends to better handle having lots of keys significantly better than filesystems handle lots of files in one directory.
- curiousgal 4y agoThank you!
- qalmakka 4y agoI think on Linux is often GNU DBM, Berkeley DB is a different, better implementation by Oracle that requires a third party module.
- chaxor 4y ago...it's... Better? But... It's Oracle... https://youtu.be/-zRN7XLCRhc https://youtu.be/-zRN7XLCRhc