Comments (7)
hey, so you are running the test script in a single process?
from yac.
My yac.ini:
extension=yac.so
yac.enable = 1
yac.keys_memory_size = 4M
yac.values_memory_size = 64M
yac.compress_threshold = -1
So maybe yes. :-)
from yac.
yac is no lock cache, that means, if you run the test scripts in multi-processes(which is the common usage, like ab -n 1000 -c 50 ) then the performance advantage will show up.. :)
and thanks for the info about shorter key length. I will look into it.
thanks
from yac.
Ah, sorry - you meant if I make a benchmark on the script, I will see the difference? That might be correct. Currently I just tried with a single process on a smaller project, where the values does not change often. But I will try this out. Thank you!
from yac.
you are welcome, any feedback is appreciated :)
from yac.
Is there any real explanation why apc should be faster with longer keys or is this only statistical variation on those tests? For me it sounds quite strange that apc should be percentually so much faster only by using longer keys... could you rerun your tests f.e. 1000 times and build median values too proof your results?
from yac.
@benbender I can't tell you why, but the key length has an effect on the benchmark results in apc. See
apc_clear_cache();
$start = microtime(true);
for ($i = 0; $i<10000; $i++) {
$key = "xxx".rand(1,100);
$value = str_repeat("x", rand(1, 1000));
if (!apc_store($key, $value)) {
var_dump("write " . $i);
}
if ($value != ($new = apc_fetch($key))) {
var_dump("read " . $i);
}
}
echo (microtime(true)-$start).'<br />';
apc_clear_cache();
$start = microtime(true);
for ($i = 0; $i<10000; $i++) {
$key = "xxx".rand(1,1000);
$value = str_repeat("x", rand(1, 1000));
if (!apc_store($key, $value)) {
var_dump("write " . $i);
}
if ($value != ($new = apc_fetch($key))) {
var_dump("read " . $i);
}
}
echo (microtime(true)-$start).'<br />';
apc_clear_cache();
$start = microtime(true);
for ($i = 0; $i<10000; $i++) {
$key = "xxx".rand(1,10000);
$value = str_repeat("x", rand(1, 1000));
if (!apc_store($key, $value)) {
var_dump("write " . $i);
}
if ($value != ($new = apc_fetch($key))) {
var_dump("read " . $i);
}
}
echo (microtime(true)-$start).'<br />';
Results:
0.038509845733643
0.039151906967163
0.041460990905762
0.037004947662354
0.038368940353394
0.040554046630859
0.037173986434937
0.038563966751099
0.040863037109375
It has no effect with yac.
from yac.
Related Issues (20)
- 请问yac的info其中几个字段的含义 HOT 1
- 【建议】get新增支持获取多维数组的某一项 HOT 1
- [2.1.0] Broken build on 32-bit HOT 2
- Serializer choice at runtime HOT 2
- Cli模式下,获取不到缓存,每次执行都在写缓存,是需要特殊配置吗? HOT 2
- 为什么ipcs -m查不到yac的共享内存,但是能访问到key,那要怎么查看呢 HOT 2
- How can I get the actual value memory usage? HOT 1
- 亲测是支持PHP8的,充分证明当年代码质量和写时考虑周全。 HOT 1
- 文档中的常量名称错误 HOT 2
- 请问通过哪个参数可以控制给yac分配的最大内存? HOT 1
- 使用 Yac 2.0.2 时出现了缓存不一致的问题 HOT 6
- PHP8.1.1+yac-2.3.1 开启 msgpack压缩报错 HOT 3
- Use in different processes HOT 5
- ab test yac poor performance than only use redis HOT 2
- win64环境安装yac扩展报错 HOT 1
- yac的info其中几个含义能说下么? HOT 1
- php7.3.1 install error
- wsl ubuntu16.04 php7.3.3 使用pecl 安装yac2.0.2 报错 recipe for target 'yac.lo' failed HOT 1
- php 7.3.4 make 错误 HOT 2
- closed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yac.