ManKyu Han wrote:
I moved "prepare" outside loop, so DBD::DBM (BerkeleyDB) works almost twice faster 
(100 -> 200 /sec) but compare to BerkeleyDB, it is still slower.
Since DBD::DBM is now using BerkeleyDB, shouldn't it perform as well as 
BerkeleyDB ?? (or at least not as bad as what I got?)
If all you need is hash lookups on a single key and your main requirement is absolute speed, then stick with straight BerkeleyDB, it is guaranteed to be faster since it doesn't have to provide you with a SQL (or any) querying interface. If you need the portability and maintainability of a SQL interface, then use DBI. If you need SQL and absolute speed, then use DBI with SQLite or PostgreSQL or MySQL or a proprietary RDBMS. If you need SQL and want to make quick prototypes of databases or handle smaller datasets where absolute speed isn't your most important criterion or you need a SQL interface to pre-existing BerkeleyDB data, then use DBD::DBM. Yes, 0.005 seconds per query is slow compared to other ways to access the data, but in many situations (e.g. a CGI environment), that amount of time will not even be perceptible compared to other things that cost time.
--
Jeff
(author of DBD::DBM)

Reply via email to