Re: Invoking cdbdump from a bash script, hanging
"Gerrit Pape" <[email protected]> Thu, 19 Dec 2002 10:11:41 +0100
| Newsgroups | gmane.comp.djb.cdb |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Dec 18, 2002 at 09:22:54PM -0800, Chris Wilkes wrote: > I'm making a CDB database with really simple entries: an MD5 hash of > an email's body and a 0 or 1 if it is non-spam or spam. A typical > transaction would be asking if an MD5 entry is in there. A non-typical > one would be changing an entry's value from 0 to 1 or vice versa. > I was going to use the Perl module CDB_File but it gets pretty slow > when you have 50k+ entries. > Then I thought about using cdbdump as the database is pretty simple. If you don't change the length of a value, you can edit the value in the binary cdb directly, without recreating the hashes. This is faster than both of your solutions. I've written such a small program for the tinydyndns package. If you want, take a look at the tinydyndns-update.c source as example, it's very simple. Regards, Gerrit.