Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

IPC::SharedCache slower than reading off disk

by Wibble (Beadle)
on Nov 23, 2001 at 02:37 UTC ( [id://127031]=perlquestion: print w/replies, xml ) Need Help??

Wibble has asked for the wisdom of the Perl Monks concerning the following question:

I'm using IPC::SharedCache to share an 8meg complex perl structure across a few processes on a linux system, but it is SLOW and not much faster than reading the object off disk using Storable's retrieve(). Any ideas why?
  • Comment on IPC::SharedCache slower than reading off disk

Replies are listed 'Best First'.
Re: IPC::SharedCache slower than reading off disk
by wog (Curate) on Nov 23, 2001 at 03:59 UTC
    Linux like most modern OSes, uses spare RAM to cache disk accesses. Thus, when you use retrieve you are probably not actually going off the disk. Also, IPC::SharedCache uses Storable to put the data structure into its shared memory segment(s) (I believe it divides the hash between multiple segments, but I'm not entirely sure.) This is because it's very hard to move perl's internal representation of these data structures into the shared memory while having it work on all processes and not having perl move it out of that space.) Also, IPC::SharedCache does synchronization to make sure that one does not write the data structure while another's reading it and get stale data, which also carries it's own overhead.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://127031]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2024-04-18 13:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found