in reply to Performance quandary
When dealing with a hash tied to a DBM, exists $hash{$key} does disk I/O. The larger the underlying database grows, the greater the number of page reads needed to check that the key exists. Getting the corresponding value requires additional page reads.
Since a single script is creating the file, and you don't need to worry about concurrent access while the file is being created, it might make sense to short-circuit existing testing by adding an in-memory hash of valid keys.
You might also consider using md5_base64(), which returns a 22 byte string instead of the 32 byte returned by md5_hex(). Given the number of records you're dealing with, that'll save you space and time.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Performance quandary
by SwellJoe (Scribe) on Feb 26, 2002 at 13:33 UTC |