Hi!
I am using a large sdbm database to store md5 hashes (as key) and about 32bytes of data per entry (as value).
$ref = tie(%hashs,'SDBM_File', "$path/hashs", O_RDWR|O_CREAT, 0644) or
+ die "Couldn't tie SDBM file: $!; aborting";
I know about sdbm's 1024/1008 bytes limit (which I am not exceeding) and sdbm is doing good work for me. As far as I know it does not drop data like mentioned in
here on my 3.5GB db with millions of records... And its fast! (beating db_file and everything else..)
But how can I make it even faster? Is there a way to tell sdbm to reduce the page size to, in my case, 160bytes? Would this give a speed gain? Or should I just reduce my amount of data to, let's say 92 bytes using a different hash and less payload. Would sdbm adapt? (how do I tell sdbm to use a different PAIRMAX like the
readme sais)
I am adding 20-60 new hashes per write-cycle. Does it help sdbm's internal seeks to feed it the hashes in sorted order? (and if so, what exactly is sdbm's internal sort? any examples?)
So many questions... Any answers?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.