blob: 539b0c566a7722ba2e361e070d49e54255c25c2f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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('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');
Benchmark::render_report('code');
echo "test completed!";
die();
|