codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
<?php $memcached_server = 'X.X.X.X'; // Bazaar issue: // If loop is set to 500 the q array takes ~90ms and the a array takes ~2ms $loop = 500; // If loop is set to 800 the q array takes ~5ms and the a array takes ~90ms //$loop = 900; // If loop is set to 650 the q array takes ~5ms and the a array takes ~5ms //$loop = 650; $m = new Memcached(); $m->addServer($memcached_server, 11211); $a = array(); $q = array(); for($i = 0; $i <= $loop; $i++) { $a[] = '1'; $q[] = '1'; $q[] = '1'; $q[] = '1'; } $m->set('test',$a); $m->set('test1',$q); $timer_rcache = microtime(true); $result = $m->get('test'); echo 'a : ' . round(1000*(microtime(true) - $timer_rcache),2) . '(ms)<br/>'; $timer_rcache = microtime(true); $result = $m->get('test1'); echo 'q : ' . round(1000*(microtime(true) - $timer_rcache),2) . '(ms)<br/>';
Private
[
?
]
Run code
Submit