summaryrefslogtreecommitdiff
path: root/tests/compare/redis-v-filecache.php
diff options
context:
space:
mode:
authorGeo Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2026-07-12 15:51:52 +0300
committerGeo Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2026-07-12 15:51:52 +0300
commit02608271bb2a9f3a65ed536984d306ee14b48e34 (patch)
tree3f23ec48a694ec014e845c4f70d9b5f1c065403c /tests/compare/redis-v-filecache.php
downloadkalassa-master.tar.gz
kalassa-master.tar.bz2
kalassa-master.zip
initialize repository; add docker config; migrate configuration to new specsHEADmaster
Diffstat (limited to 'tests/compare/redis-v-filecache.php')
-rwxr-xr-xtests/compare/redis-v-filecache.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/compare/redis-v-filecache.php b/tests/compare/redis-v-filecache.php
new file mode 100755
index 0000000..3cb6536
--- /dev/null
+++ b/tests/compare/redis-v-filecache.php
@@ -0,0 +1,35 @@
+<?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('redis-set-start');
+foreach($products as $product) {
+ RedisCache::set('prod'.$product['ID'], $product, 600);
+}
+
+Benchmark::add_spot('redis-get-start');
+foreach($products as $product) {
+ $x = RedisCache::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();
+
+