Does using dbmopen/tie make programs memory-efficient?

H

Henry Salvia

I have inherited a script that uses dbmopen to create a hash that holds
up to
500,000 keys. Does use of dbmopen (or tie) make a script use less memory
or
provide any other efficiency, or is it just the persistence of the data
that
adds value? How would I go about measuring (on UNIX) memory usage
between using
dbmopen/tie and not? The docs for dbmopen and tie don't talk about
memory
use or efficency that I can find.
Thanks.
Henry Salvia
 
A

anno4000

[please keep your line length below 72]
I have inherited a script that uses dbmopen to create a hash that holds
up to
500,000 keys. Does use of dbmopen (or tie) make a script use less memory
or

dbmopen() is deprecated. You should use tie() instead.
provide any other efficiency, or is it just the persistence of the data
that

It's often the primary purpose of DB_File (or whatever) to remove
a large hash from memory and keep it on disk. Persistence is another.
adds value? How would I go about measuring (on UNIX) memory usage
between using
dbmopen/tie and not? The docs for dbmopen and tie don't talk about
memory
use or efficency that I can find.

For coarse comparisons, follow the process(es) with ps and look at
their storage consumption.

Anno
 
J

J. Gleixner

Henry said:
I have inherited a script that uses dbmopen to create a hash that holds
up to
500,000 keys. Does use of dbmopen (or tie) make a script use less memory

Compared to what?
or
provide any other efficiency, or is it just the persistence of the data
that
adds value? How would I go about measuring (on UNIX) memory usage
between using dbmopen/tie and not?

Write something that doesn't use it and compare it.

The docs for dbmopen and tie don't talk about
memory use or efficency that I can find.

It uses much less memory, compared to reading the data into a hash.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top