diff options
| author | Geo Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2026-07-12 15:51:52 +0300 |
|---|---|---|
| committer | Geo Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2026-07-12 15:51:52 +0300 |
| commit | 02608271bb2a9f3a65ed536984d306ee14b48e34 (patch) | |
| tree | 3f23ec48a694ec014e845c4f70d9b5f1c065403c /tests/compare/memcached-v-filecache.php | |
| download | kalassa-master.tar.gz kalassa-master.tar.bz2 kalassa-master.zip | |
Diffstat (limited to 'tests/compare/memcached-v-filecache.php')
| -rwxr-xr-x | tests/compare/memcached-v-filecache.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/compare/memcached-v-filecache.php b/tests/compare/memcached-v-filecache.php new file mode 100755 index 0000000..4ffdfed --- /dev/null +++ b/tests/compare/memcached-v-filecache.php @@ -0,0 +1,34 @@ +<?php +echo "test started... "; +ob_flush(); + +Benchmark::add_spot('query-10000-products'); +$db = Registry::use('database'); +$products = $db->runQuery("SELECT * FROM products LIMIT 10000",[]); + +Benchmark::add_spot('memcached-set-start'); +foreach($products as $product) { + MemcachedCache::set('prod'.$product['ID'], $product, 600); +} + +Benchmark::add_spot('memcached-get-start'); +foreach($products as $product) { + $x = MemcachedCache::get('prod'.$product['ID']); +} + +Benchmark::add_spot('filecache-set-start'); +foreach($products as $product) { + FileCache::set('prod'.$product['ID'], $product, 600); +} + +Benchmark::add_spot('filecache-get-start'); +foreach($products as $product) { + $x = FileCache::get('prod'.$product['ID']); +} + +Benchmark::add_spot('end'); +echo(Benchmark::report(BENCH_REPORT_COMMENT)); +echo "test completed!"; + +die(); + |
