keymon has asked for the wisdom of the Perl Monks concerning the following question:
tie %hash, 'GDBM_File', $filename, &GDBM_WRCREAT, 0640;The problem is, the keys are sorted and the script gets bogged down rearranging data on disk as it is being built (from looking at the output of top, it is perpetually on disk wait. it doesn't help that the disk is a slow IDE drive :( ). My question is: is it possible to build the database in memory, and then just write it out in one fell swoop?
Update: A simple little flag made a _WORLD_ of difference. We're talking a 1000x increase in performance here. I added &GDBM_FAST to the tie flags, and this thing flies now:
tie %hash, 'GDBM_File', $filename, &GDBM_WRCREAT|&GDBM_FAST, 0640;Thank you everyone for replying; even if your replies didn't solve the problem, I am grateful that you took the time to respond. :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: GDBM_File to memory?
by BrowserUk (Patriarch) on Dec 23, 2005 at 01:00 UTC | |
|
Re: GDBM_File to memory?
by tirwhan (Abbot) on Dec 23, 2005 at 07:00 UTC | |
by keymon (Beadle) on Dec 23, 2005 at 19:32 UTC | |
|
Re: GDBM_File to memory?
by perrin (Chancellor) on Dec 23, 2005 at 04:40 UTC | |
by keymon (Beadle) on Dec 23, 2005 at 19:33 UTC |