I want to give a comparison of the performance of two amazing (and, in my humble opinion, delightful) frameworks,
Kohana and
Codeigniter . The test is synthetic, but, it seems to me, still interesting.
Test conditions
In both frameworks, I did not use the view, but only the work inside the controllers. DB: Postgresql 8.3 on localhost. Both controllers have the simplest form.
In the first test, there was a simple loop in 333 iterations, inside of which a call was made to the database on the following request:
SELECT *
FROM tbl_clients
JOIN tbl_clients_recvisites ON tbl_clients.clientid = tbl_clients_recvisites.clientid
JOIN tbl_recvisites ON tbl_clients_recvisites.recvisiteid = tbl_recvisites.recvisiteid
JOIN tbl_clients_contacts ON tbl_clients.clientid = tbl_clients_contacts.clientid
JOIN tbl_contacts ON tbl_clients_contacts.contactid = tbl_contacts.contactid
* This source code was highlighted with Source Code Highlighter .
Additionally, a profiler built into both controllers was included.
In the second test
Apache JMeter was used.Test One - Pure Synthetics Without Emulation
On each of the frameworks, I repeated the actions 10 times (10 times [F5]) and recorded the results of the application execution (delivery time is not taken into account - only
PHP works). The results in the table:
| Codeigniter | Kohana |
---|
one | 26,6959 | 14,808 |
2 | 26.6049 | 14,178 |
3 | 27,5487 | 14,289 |
four | 26,7427 | 13,845 |
five | 26.6099 | 14,554 |
6 | 26,5644 | 14,381 |
7 | 26,9622 | 13,717 |
eight | 26,8828 | 14,242 |
9 | 27.2445 | 13,771 |
ten | 26,8514 | 14,479 |
The average | 26.87 | 14.23 |
And further.
Important note : Codeigniter consumed 1.74 MB of RAM in this test, and Kohana - 1.35 MB
Test Two - Approaching Reality
This test used JMeter to simulate simultaneous requests.
The test consisted in the following. Each of the subjects (CI and KOH) sent 10 simultaneous streams of 5 requests each (in the stream they will be performed in turn), but not to “kill” the stand, the number of queries to the database was reduced from 333 to 9 (well Yes, I love the number 3;))
In the first case, the frameworks gave the profiler data, but they turned out to be different in the amount of bytes transferred, so I conducted the second series of tests when both frameworks gave out only 2 bytes ('ok') after the work was done. Each test was run in JMeter 3 times.
Summary Tables:
Codeigniter 9 requests profiler enabledAverage (ms) | Min (ms) | Max. (ms) | Throughput (queries / sec) | Kb / s |
---|
3880 | 2492 | 4370 | 2.5 | 57.17 |
3729 | 2538 | 4105 | 2.6 | 59.5 |
3760 | 2608 | 4263 | 2.6 | 59.04 |
Kohana 9 requests profiler enabledAverage (ms) | Min (ms) | Max. (ms) | Throughput (queries / sec) | Kb / s |
---|
2495 | 1104 | 2990 | 3.9 | 27.62 |
2462 | 1239 | 2873 | 3.9 | 27.89 |
2485 | 933 | 2955 | 3.9 | 27.68 |
Codeigniter 9 requests, output 'ok'Average (ms) | Min (ms) | Max. (ms) | Throughput (queries / sec) | Kb / s |
---|
3749 | 2778 | 4241 | 2.6 | 0.01 |
3691 | 2187 | 4111 | 2.6 | 0.01 |
3776 | 3041 | 4208 | 2.6 | 0.01 |
Kohana 9 requests, output 'ok'Average (ms) | Min (ms) | Max. (ms) | Throughput (queries / sec) | Kb / s |
---|
2451 | 1035 | 2870 | 3.9 | 0.01 |
2445 | 997 | 2924 | 3.9 | 0.01 |
2448 | 1266 | 2883 | 3.9 | 0.01 |
As can be seen from these tables, the number of bytes returned during the operation of applications did not have any effect.
')
findings
Everyone makes conclusions for himself, I just decided to test such similar, but at the same time, different frameworks. For myself, I think I did it.
Never forget that for every job there is the most suitable tool for it ...