Created
September 11, 2010 05:32
-
-
Save soh335/574865 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'Benchmark/Timer.php'; | |
$bm = new Benchmark_Timer(); | |
$bm->start(); | |
$memcache = new Memcache(); | |
$memcache->addServer('localhost', 1978); | |
$memcache->flush(); | |
$bm->setMarker('memcache_prepare'); | |
for ($i = 0; $i < 100000; $i++) | |
{ | |
$memcache->set(md5($i), crc32($i), false); | |
} | |
$bm->setMarker('memcache_tokyotyrant_set'); | |
for ($i = 0; $i < 100000; $i++) | |
{ | |
$memcache->get(md5($i)); | |
} | |
$bm->setMarker('memcache_tokyotyrant_get'); | |
$tokyotyrant = new TokyoTyrant('localhost', 1978); | |
$tokyotyrant->vanish(); | |
$bm->setMarker('prepare_tokyotyrant'); | |
for ($i = 0; $i < 100000; $i++) | |
{ | |
$tokyotyrant->put(md5($i), crc32($i)); | |
} | |
$bm->setMarker('tokyotyrant_set'); | |
for ($i = 0; $i < 100000; $i++) | |
{ | |
$tokyotyrant->get(md5($i)); | |
} | |
$bm->setMarker('tokyotyrant_get'); | |
$bm->stop(); | |
$bm->display(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------------------------------------------- | |
marker time index ex time perct | |
----------------------------------------------------------------------- | |
Start 1284182998.50462700 - 0.00% | |
----------------------------------------------------------------------- | |
memcache_prepare 1284182998.69161800 0.186991 0.62% | |
----------------------------------------------------------------------- | |
memcache_tokyotyrant_set 1284183007.53896400 8.847346 29.43% | |
----------------------------------------------------------------------- | |
memcache_tokyotyrant_get 1284183015.40895100 7.869987 26.18% | |
----------------------------------------------------------------------- | |
prepare_tokyotyrant 1284183015.61814100 0.209190 0.70% | |
----------------------------------------------------------------------- | |
tokyotyrant_set 1284183022.14325600 6.525115 21.70% | |
----------------------------------------------------------------------- | |
tokyotyrant_get 1284183028.56892900 6.425673 21.37% | |
----------------------------------------------------------------------- | |
Stop 1284183028.56895400 0.000025 0.00% | |
----------------------------------------------------------------------- | |
total - 30.064327 100.00% | |
----------------------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment