First of all *hungry, sorry
This is how the website i created in ZF Yii and Kohana looks
Just curious what is the most memory consuming framework?
I think if we take the most popular ones, ZF and Symfony2 I believe the most consuming…
I did a little test
For example if you compare Kohana with yii, with op code cache exactly the same website main page -
Kohana consume 400kb memory and it takes it 0.05 avg sec.
Yii doing the same using 1.1mb 0.02 avg sec.
Without op code cache
kohana 1.26 MB 0.1 сек. avg
Yii 3.132 mb Execution: 0.1 avg sec.
Yii way better than kohana in all aspects, but just interesting that Yii consume a lot of memory…
I just considering, if you develope some script for selling, and it can be on shared cheap hosting…
Maybe it is better to stick with less memory consuming FW ?
This is for example what Yii loaded, don’t sure if I can really cut the memory consumption
echo CVarDumper::dump(get_included_files(),10,true);
at end of index.php
And this is kohana (with Yii’s CVarDumper )
As you can see, in Yii I put most of the stuff in main template, but in Kohana I used blocks… so it means kohana can consume little less, and it can make it a little bit faster.
Actually tried to follow Yii includes and for now I can’t figure out where is the most heavy memory eating…
Maybe you curious about more framework with the same website…
So lets welcome Zend Frameworok
Used exactly the same block structure as with yii test, with banch of render partial etc.
the results are:
with op code cache:
avg time
0.02 sec.
Memory: 1113.195 kb
Peak: 1198.812 kb
(my custom view helper benchmark for Zend Framework )
without op code cache (actually used all the time zend optimizer+ on my zend server for all tests)
avg time 0.1 sec.
| Memory: 4262.648 kb | Peak: 4337.344 kb
files included:
I need to say more about zend…
Actually my test is kind of unfair for him…
Because I have
resources.db.adapter = "PDO_SQLITE"
resources.db.params.dbname = APPLICATION_PATH "/data/db/db1.db"
resources.db.isDefaultTableAdapter = true
In my application.ini
While Yii uses lazy loading if I don’t use now the sqlite…
ZF includes it
So to be fare, if I remove this lines , cause I don’t really use DB in the test
avg time 0.1 sec. | Memory: 3197.203 kb | Peak: 3272.422 kb
And with op code cache
avg 0.018 sec. | Memory: 938.422 kb | Peak: 1024.031 kb
kicking Yii *ss
Included files the same, just db classes not included
And now cakephp…
I must say I don’t had the patience to learn it, so I just echo hello world from controller, no layout no render partials…
I give it 5 minutes to understand from documentation how to use layouts and views, but it is not logic to me and no good info in documentation…
If some one can create me a test app with layouts and views and content block with partial rendering, I would be glad
But for now
Cakephp:
With op code cache
0.02 avg time
727kb memory
without op code cache
3313
0.1 avg time
This is the included files
put get_included_files
in end of webroot/index.php maybe it is wrong, never worked with this FW
Summary
[b]Versions used:
Yii 1.1.8
Kohana: 3.2
ZF 1.11.10
cakephp 1.13.12[/b]
[i]note:
while in Yii kohana and zf was exactly the same website,
cakephp I used a simple echo "hello world"
because I don’t have the time to learn the documentation and it wasent at all intuitive … I must say it differs a lot from all the other frameworks I worked with…
[/i]
With op code cache (zend optimizer+ used on zend server)
[b]Kohana 400kb / 0.05 avg sec
Yii 1.1mb / 0.02 avg sec.
ZF w/ 1113.195 kb / 0.02 sec.
ZF w/o 938.422 kb / 0.018 sec.
Cakephp 727kb / 0.02 avg
(but it is simple echo so you can multiply it for about 50% i believe)[/b]
No op code cache
[b]kohana 1.26 MB / 0.1 сек. avg
Yii 3.132 mb / 0.1 avg sec.
ZF w/ 4262.648 / 0.1 avg
ZF w/o 3197.203 / 0.1 avg
cakephp 3313mb / 0.1 avg
[/b]
So the winners…
For this specific test and simple website I chose
Kohana is A winner in memory consumption
really small memory footprint
In speed, Yii and ZF twice faster than Kohana
If we make ZF to load lazy the DB classes, like Yii doing
because all FW where configured with pdo+sqlite
ZF wins… (sometimes it as fast as 0.012)
P.S.
My personal framework kick all of this frameworks
With really queries for news and top websites
w/ op code cache
It doing 2 db queries
generation avg time:
0.007 sec.
using memory: 365.547 kb
The screen is from it…
but all looks the same