Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
> I think you benchmark is flawed. You say you have 20_000 random 
> entries, but you only make 2723 queries.

How did you determine that I made only 2723 queries? The benchmark shows that I made 40_000 queries for each code fragment at a rate of 2723 queries per second with the memcache process and 3846 queries per second with the straight-from-db process. Or, am I reading the results wrong?

Update: Here is another measurement, this time using timethese. The results are the same as before.

query_dbh: 24 wallclock secs ( 5.28 usr + 5.29 sys = 10.57 CPU) @ 37 +84.30/s (n=40000) query_mem: 70 wallclock secs ( 7.80 usr + 6.08 sys = 13.88 CPU) @ 28 +81.84/s (n=40000)

Whatever I am doing, it is far faster to open up the SQLite database every time and query it than it is to query the memory cached value. (I am creating a $dbh and $sth every time, and also opening a file and writing to it every time to kinda emulate a CGI process that starts afresh on every hit of the browser.

when small people start casting long shadows, it is time to go to bed

In reply to Re^2: learning memcached by punkish
in thread learning memcached by punkish

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others lurking in the Monastery: (7)
    As of 2018-07-17 11:49 GMT
    Find Nodes?
      Voting Booth?
      It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

      Results (363 votes). Check out past polls.