*[In Release 0.0.6](https://github.com/semasping/php_frameworks_for_tests/releases/tag/0.0.6):* * Add new tests for phalcon: * Use Cache for load posts from DB in 'posts' most heavy page. * Add posibility for viewing testing result of releseas * results for 0.0.5 * results of testing release 0.0.6 ### More informations about changes. About cache and eager loading in laravel, I wrote in my previews post. Now we add caching functional on page 'posts' in phalcon framework. Let`s add new Controller: `PostwsController() in phalcon-3.2/app/controllers/PostswcController.php` ``` use Phalcon\Cache\Backend\File as BackFile; use Phalcon\Cache\Frontend\Data as FrontData; /** * Index action */ public function indexAction() { $posts = null; $frontCache = new FrontData( [ 'lifetime' => 172800, ] ); $cache = new BackFile( $frontCache, [ 'cacheDir' => '../app/cache/', ] ); $cacheKey = 'posts.cache'; $posts = $cache->get($cacheKey); if ($posts === null) { $this->persistent->parameters = null; $parameters = $this->persistent->parameters; if (!is_array($parameters)) { $parameters = []; } //$parameters["limit"] = "100"; //$parameters["limit"] = array('number' => 100, 'offset' => 10); $parameters["order"] = "id"; $posts = Posts::find($parameters); $cache->save($cacheKey, $posts); } if (count($posts) == 0) { $this->flash->notice("The search did not find any posts"); $this->dispatcher->forward([ "controller" => "postsCache", "action" => "index" ]); return; } //var_dump($posts); $this->view->posts = $posts; } ``` Views we can copy from posts to postswc: ``` phalcon-3.2/app/views/layouts/posts.phtml -> phalcon-3.2/app/views/layouts/postswc.phtml folder phalcon-3.2/app/views/posts -> folder phalcon-3.2/app/views/postswc ``` And that`s all. New page 'postswc' we can see by link [](http://php-frameworks.semasping.info/phalcon-3.2/public/postswc) After tests we see that adding a cache did not change the situation. In table `!!phalcon-postswc` row. |framework |requests per second|relative|peak memory|relative| |-------------------|------------------:|-------:|----------:|-------:| |phalcon-index | 113.17| 2,829.3| 0.49| 1.0| |phalcon-authors | 22.35| 558.8| 0.61| 1.3| |phalcon-categories | 13.61| 340.3| 0.62| 1.3| |laravel-index | 8.67| 216.8| 6.21| 12.7| |laravel-posts-el-cache| 8.00| 200.0| 7.34| 15.1| |laravel-posts-el | 7.79| 194.8| 7.34| 15.1| |laravel-categories | 6.97| 174.3| 7.59| 15.6| |laravel-authors | 6.90| 172.5| 7.34| 15.1| |!! phalcon-postswc | 0.10| 2.5| 2.45| 5.0| |phalcon-posts | 0.09| 2.3| 2.36| 4.8| |laravel-posts | 0.04| 1.0| 15.13| 31.0| |laravel-posts-cache| 0.04| 1.0| 18.46| 37.9|  ##### I'll tell you about adding `eager loading` next time, because there is not `eager loading` in Phalcon `from the box`. ##### In this release I have change the sctructure for releases result viewing. For every next release it's testing results will be commited in repository (`bm/result-releases/0.0.5/output`, `bm/result-releases/0.0.6/output`, `bm/result-releases/...../output`, etc.) And they can be viewed on [http://php-frameworks.semasping.info/bm/result-releases/0.0.6/index.php](http://php-frameworks.semasping.info/bm/result-releases/0.0.6/index.php) where `0.0.6` - release version. That links will be added to release informations on github #### This release: [https://github.com/semasping/php_frameworks_for_tests/releases/tag/0.0.6](https://github.com/semasping/php_frameworks_for_tests/releases/tag/0.0.6) #### Commits in this release: * [results for 0.0.5](https://github.com/semasping/php_frameworks_for_tests/commit/9d8474134a163869ddcbf71532b0e28360a702cb) * [new structure for releases result viewing](https://github.com/semasping/php_frameworks_for_tests/commit/fa9801a67a19b2985f7cd9f1e200f4901a312a12) * [add cache tests for phalcon (for release 0.0.6)](https://github.com/semasping/php_frameworks_for_tests/commit/5e2e48b53e5b3112fe4e34910e989258adb1f9b5) * [result of testing release 0.0.6](https://github.com/semasping/php_frameworks_for_tests/commit/1e064a61a8e31e229f85f643b952e44ab6969145) ## Roadmap: * ~~Try to use Cache for all frameworks~~ (Done for laravel. Done for Phalcon) * Find Eager Loading functional for Phalcon 3.2 (or try `stibiumz/phalcon.eager-loading` for Phalcon 1.3.* - 2.0.*.) * Implementing a test application and running tests on Symfony * Implementing a test application and running tests on Yii * Connection with https://blackfire.io/ * Deal with the Docker and wrap it all up in it. To be able to quickly deploy to a more powerful server for comparison. #### PS: More information about structure of test application * Part 1. [Introduction](https://steemit.com/programming/@semasping/benchmarking-php-frameworks-part-1). - Why i decide to do new bencmark of php frameworks. * Part 2. [Database scheme and generating data for testing app](https://steemit.com/programming/@semasping/benchmarking-php-frameworks-part-2-database-scheme-and-generating-data-for-testing-app). - Description of application, database structure and data. * Part 3. [Phalcon](https://steemit.com/programming/@semasping/benchmarking-php-frameworks-part-3-phalcon) * Part 4. [Laravel](https://steemit.com/programming/@semasping/benchmark-php-frameworks-part-5-laravel) * Part 5. [Cache and Eager Loading for Laravel framework](https://steemit.com/utopian-io/@semasping/cache-and-eager-loading-for-laravel-framework-benchmark-of-php-frameworks-v0-0-5) <br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@semasping/add-cache-for-phalcon-benchmark-of-php-frameworks-v0-0-6">Utopian.io - Rewarding Open Source Contributors</a></em><hr/>
author | semasping | ||||||
---|---|---|---|---|---|---|---|
permlink | add-cache-for-phalcon-benchmark-of-php-frameworks-v0-0-6 | ||||||
category | utopian-io | ||||||
json_metadata | {"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":95885735,"name":"php_frameworks_for_tests","full_name":"semasping/php_frameworks_for_tests","html_url":"https://github.com/semasping/php_frameworks_for_tests","fork":false,"owner":{"login":"semasping"}},"pullRequests":[],"platform":"github","type":"development","tags":["utopian-io","programming","phpframework","phalcon","laravel"],"users":["semasping"],"links":["https://github.com/semasping/php_frameworks_for_tests/releases/tag/0.0.6","https://steemitimages.com/DQme6B99o1s4f8LpKMfXnHWSc3AcroAShYSgT5PdAtgfNHm/006screenshot-php-frameworks.semasping.info%202018-01-29%2020-43-59-307.png","http://php-frameworks.semasping.info/bm/result-releases/0.0.6/index.php","https://github.com/semasping/php_frameworks_for_tests/commit/9d8474134a163869ddcbf71532b0e28360a702cb","https://github.com/semasping/php_frameworks_for_tests/commit/fa9801a67a19b2985f7cd9f1e200f4901a312a12","https://github.com/semasping/php_frameworks_for_tests/commit/5e2e48b53e5b3112fe4e34910e989258adb1f9b5","https://github.com/semasping/php_frameworks_for_tests/commit/1e064a61a8e31e229f85f643b952e44ab6969145","https://steemit.com/programming/@semasping/benchmarking-php-frameworks-part-1","https://steemit.com/programming/@semasping/benchmarking-php-frameworks-part-2-database-scheme-and-generating-data-for-testing-app","https://steemit.com/programming/@semasping/benchmarking-php-frameworks-part-3-phalcon","https://steemit.com/programming/@semasping/benchmark-php-frameworks-part-5-laravel","https://steemit.com/utopian-io/@semasping/cache-and-eager-loading-for-laravel-framework-benchmark-of-php-frameworks-v0-0-5"],"image":["https://steemitimages.com/DQme6B99o1s4f8LpKMfXnHWSc3AcroAShYSgT5PdAtgfNHm/006screenshot-php-frameworks.semasping.info%202018-01-29%2020-43-59-307.png"],"moderator":{"account":"helo","time":"2018-01-30T00:39:22.498Z","reviewed":true,"pending":false,"flagged":false}} | ||||||
created | 2018-01-29 20:14:33 | ||||||
last_update | 2018-01-30 00:39:21 | ||||||
depth | 0 | ||||||
children | 4 | ||||||
last_payout | 2018-02-05 20:14:33 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 59.521 HBD | ||||||
curator_payout_value | 26.200 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 6,413 | ||||||
author_reputation | 8,942,708,173,193 | ||||||
root_title | "Add cache for Phalcon [Benchmark of php frameworks v0.0.6]" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 33,368,118 | ||||||
net_rshares | 14,304,297,058,847 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
grumlin | 0 | 54,068,498,166 | 5% | ||
ukrainian | 0 | 12,741,163,660 | 100% | ||
celebr1ty | 0 | 13,911,238,075 | 5% | ||
t3ran13 | 0 | 3,875,545,012 | 9% | ||
frol | 0 | 4,250,364,872 | 100% | ||
gapel | 0 | 634,201,962 | 100% | ||
ianboil | 0 | 3,013,946,561 | 100% | ||
weloverandom | 0 | 266,262,085 | 100% | ||
detlef-s | 0 | 11,362,151,834 | 100% | ||
erikaflynn | 0 | 37,093,597,970 | 100% | ||
php-node-client | 0 | 266,537,550 | 5% | ||
dimarss | 0 | 6,883,348,876 | 26% | ||
miniature-tiger | 0 | 64,730,734,787 | 100% | ||
olesia | 0 | 1,296,527,563 | 100% | ||
mys | 0 | 37,202,831,233 | 100% | ||
exan | 0 | 9,531,196,735 | 100% | ||
hadasegunda | 0 | 390,169,073 | 100% | ||
aurus | 0 | 479,590,800 | 100% | ||
avtoledy | 0 | 328,438,408 | 100% | ||
vikfrei | 0 | 1,439,615,662 | 100% | ||
semasping | 0 | 1,789,524,270 | 100% | ||
ladyzarulem | 0 | 511,421,578 | 100% | ||
yushkov | 0 | 1,359,768,607 | 100% | ||
vasilisapor2 | 0 | 1,870,603,033 | 100% | ||
sandan | 0 | 469,970,409 | 100% | ||
lengalenga | 0 | 402,716,771 | 100% | ||
vict0r | 0 | 474,996,542 | 100% | ||
nonsense | 0 | 461,507,342 | 100% | ||
zavz9t | 0 | 232,351,979 | 50% | ||
v-mi | 0 | 387,136,934 | 70% | ||
lego-cat | 0 | 333,298,800 | 60% | ||
utopian-io | 0 | 14,007,139,927,726 | 9.67% | ||
ihtiht | 0 | 5,638,485,195 | 100% | ||
ccworld | 0 | 120,517,118 | 30% | ||
brainmechanc9en | 0 | 476,873,000 | 100% | ||
realinfo | 0 | 13,152,157,468 | 100% | ||
matren | 0 | 392,154,705 | 100% | ||
photo-travel | 0 | 275,818,063 | 100% | ||
solnishko | 0 | 457,389,378 | 100% | ||
meskalinerush | 0 | 470,095,396 | 100% | ||
russiancommunity | 0 | 281,273,603 | 100% | ||
fractal-team | 0 | 497,628,825 | 100% | ||
zlata777 | 0 | 402,594,917 | 100% | ||
viki27 | 0 | 345,934,167 | 100% | ||
mrfantastis | 0 | 398,488,367 | 100% | ||
lika0812 | 0 | 352,056,003 | 100% | ||
iotman | 0 | 435,424,900 | 100% | ||
marimag | 0 | 430,127,701 | 100% | ||
koss87 | 0 | 457,778,685 | 100% | ||
mdnazmul | 0 | 457,774,845 | 100% | ||
theghil-gayo | 0 | 55,301,636 | 100% |
Ни фига не поняла, но я За! За качественные вклады в мир open-source:-)
author | erikaflynn |
---|---|
permlink | re-semasping-add-cache-for-phalcon-benchmark-of-php-frameworks-v0-0-6-20180130t184350782z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-01-30 18:43:51 |
last_update | 2018-01-30 18:43:51 |
depth | 1 |
children | 0 |
last_payout | 2018-02-06 18:43:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 71 |
author_reputation | 12,282,595,621,854 |
root_title | "Add cache for Phalcon [Benchmark of php frameworks v0.0.6]" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 33,636,097 |
net_rshares | 0 |
Thank you for the contribution. It has been approved. Very detailed Please add a license to your repo. You can contact us on [Discord](https://discord.gg/uTyJkNm). **[[utopian-moderator]](https://utopian.io/moderators)**
author | helo |
---|---|
permlink | re-semasping-add-cache-for-phalcon-benchmark-of-php-frameworks-v0-0-6-20180130t004016977z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"} |
created | 2018-01-30 00:40:18 |
last_update | 2018-01-30 00:40:18 |
depth | 1 |
children | 1 |
last_payout | 2018-02-06 00:40:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 223 |
author_reputation | 121,547,934,535,311 |
root_title | "Add cache for Phalcon [Benchmark of php frameworks v0.0.6]" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 33,418,853 |
net_rshares | 0 |
Thank you! >Please add a license to your repo Done
author | semasping |
---|---|
permlink | re-helo-re-semasping-add-cache-for-phalcon-benchmark-of-php-frameworks-v0-0-6-20180130t023216907z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-01-30 02:32:15 |
last_update | 2018-01-30 02:32:15 |
depth | 2 |
children | 0 |
last_payout | 2018-02-06 02:32:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 52 |
author_reputation | 8,942,708,173,193 |
root_title | "Add cache for Phalcon [Benchmark of php frameworks v0.0.6]" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 33,441,636 |
net_rshares | 0 |
### Hey @semasping I am @utopian-io. I have just upvoted you! #### Achievements - You have less than 500 followers. Just gave you a gift to help you succeed! - Seems like you contribute quite often. AMAZING! #### Community-Driven Witness! I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER! - <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a> - <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a> - Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a> [](https://steemit.com/~witnesses) **Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
author | utopian-io |
---|---|
permlink | re-semasping-add-cache-for-phalcon-benchmark-of-php-frameworks-v0-0-6-20180131t031327470z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"} |
created | 2018-01-31 03:13:27 |
last_update | 2018-01-31 03:13:27 |
depth | 1 |
children | 0 |
last_payout | 2018-02-07 03:13:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,085 |
author_reputation | 152,955,367,999,756 |
root_title | "Add cache for Phalcon [Benchmark of php frameworks v0.0.6]" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 33,737,724 |
net_rshares | 0 |