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.

In reply to Re: IPC::SharedCache slower than reading off disk by wog
in thread IPC::SharedCache slower than reading off disk by Wibble

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.