Live data from Hacker News

Cdb: a fast, reliable, simple package for creating, reading constant databases

cr.yp.to

41–43 of 43 posts

Re: Cdb: a fast, reliable, simple package for creating, reading constant databases

#41
post #28
post #24

Earlier quoted context omitted.

Any links to theory behind cdb?

I'd be particularly interested to know why there are 256 hashtables, rather than one, or some other number. I don't think i've seen this hybrid trie-hashtable before. I wonder if there's any mileage in using a perfect hash function to build a database like this. It seems suited to the operating model of being slow to build but fast to access.

i second that; if anyone knows why there are 256 hashtables rather than just 1, please speak up. my only guess is that it might be a way to prevent 32-bit int overflow in the C code..

Re: Cdb: a fast, reliable, simple package for creating, reading constant databases

#42

Weird side-note, when using CDB's from Perl, do not use tie, its painfully unperformant (realized this the hard way)

Indeed the documentation notes this. https://metacpan.org/pod/CDB_File#PERFORMANCE

I was handed code that used tie, took me a while to realize what was killing my perf..
Post reply on HN