in reply to DBM::Deep overhead
Which approach is more appropriate for what you want to do? Purpose-wise, I submit that these two packages are apples and oranges.
Storable is a package that is designed for use as a persistence-framework. You take a moderate amount of data in RAM and “freeze” it into a representation that you can, say, stuff into an HTTP session-store.
DBM::Deep, on the other hand, describes itself as “a unique flat-file database module, written in pure Perl.” DBM::Deep::Cookbook, in the Performance section, makes the following additional caution:
Because DBM::Deep is a concurrent datastore, every change is flushed to disk immediately and every read goes to disk. This means that DBM::Deep functions at the speed of disk (generally 10-20ms) vs. the speed of RAM (generally 50-70ns), or at least 150-200x slower than the comparable in-memory datastructure in Perl.
Okay, nothing at all wrong with that. “This is what you get, and this is the price you will pay to get it.”
Consider all of your various options, even within DBM::Deep. For example, SQLite is a rock-solid single file on-disk data store that is used by everything on the planet including the cell-phone in your pocket. (It, too, normally commits all writes to disk immediately, so you must use Transactions effectively to get decent performance out of it.)
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: DBM::Deep overhead
by perlpipe (Acolyte) on Apr 21, 2011 at 02:21 UTC |