Kohana vs Codeigniter, Performance Synthetics
I want to compare the performance of two amazing (and, in my humble opinion, amazing) frameworks, Kohana and Codeigniter . The test is synthetic, but, it seems to me, still interesting.
In both frameworks I did not use view, but only work inside controllers. DB: Postgresql 8.3 on localhost. Both controllers have the simplest form.
In the first test, there was a simple cycle in 333 iterations, inside which a call to the database was launched by the following request:
Additionally, a profiler integrated in both controllers was included.
The second test used Apache JMeter
On each of the frameworks, I repeated the actions 10 times (10 times [F5]) and recorded the results of the application (delivery time is not taken into account - only PHP work ). Results in the table:
And further. Important note : Codeigniter consumed 1.74MB of RAM in this test, and Kohana - 1.35MB
This test used JMeter to simulate concurrent requests.
The test was as follows. For each of the subjects (CI and KOH), 10 simultaneous threads were sent with 5 requests each (in the thread they will be executed in turn), but in order not to “kill” the stand, the number of database queries was reduced from 333 to 9 (well yes, I love the number 3;))
In the first case, the framework gave the profiler data, but they turned out to be different in the amount of bytes transmitted, so I conducted the second series of tests when both frameworks gave only 2 bytes ('ok') after the work was done. Each test was run in JMeter 3 times. Summary
Tables:
Codeigniter 9 Query Profiler Enabled
Kohana 9 profiler requests enabled
Codeigniter 9 queries,'ok 'output
Kohana 9 searches, output'ok '
As can be seen from these tables, the number of bytes given during application operation did not affect in any way.
Everyone makes conclusions for himself, I just decided to test such similar, but at the same time different frameworks. For myself, I seem to have made it.
In no case do not forget that for each work there is the most suitable tool for it ...
Test conditions
In both frameworks I did not use view, but only work inside controllers. DB: Postgresql 8.3 on localhost. Both controllers have the simplest form.
In the first test, there was a simple cycle in 333 iterations, inside which a call to the database was launched by 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 integrated in both controllers was included.
The second test used Apache JMeter
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 (delivery time is not taken into account - only PHP work ). Results in the table:
Codeigniter | Kohana | |
---|---|---|
1 | 26,6959 | 14,808 |
2 | 26,6049 | 14,178 |
3 | 27,5487 | 14,289 |
4 | 26.7427 | 13,845 |
5 | 26,6099 | 14,554 |
6 | 26,5644 | 14,381 |
7 | 26.9622 | 13,717 |
8 | 26.8828 | 14,242 |
9 | 27.2445 | 13,771 |
10 | 26.8514 | 14,479 |
Average | 26.87 | 14.23 |
And further. Important note : Codeigniter consumed 1.74MB of RAM in this test, and Kohana - 1.35MB
Test Two - Approaching Reality
This test used JMeter to simulate concurrent requests.
The test was as follows. For each of the subjects (CI and KOH), 10 simultaneous threads were sent with 5 requests each (in the thread they will be executed in turn), but in order not to “kill” the stand, the number of database queries was reduced from 333 to 9 (well yes, I love the number 3;))
In the first case, the framework gave the profiler data, but they turned out to be different in the amount of bytes transmitted, so I conducted the second series of tests when both frameworks gave only 2 bytes ('ok') after the work was done. Each test was run in JMeter 3 times. Summary
Tables:
Codeigniter 9 Query Profiler Enabled
Average (ms) | Min (ms) | Max. (ms) | Throughput (requests / 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 profiler requests enabled
Average (ms) | Min (ms) | Max. (ms) | Throughput (requests / 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 queries,'ok 'output
Average (ms) | Min (ms) | Max. (ms) | Throughput (requests / 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 searches, output'ok '
Average (ms) | Min (ms) | Max. (ms) | Throughput (requests / 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 given during application operation did not affect in any way.
conclusions
Everyone makes conclusions for himself, I just decided to test such similar, but at the same time different frameworks. For myself, I seem to have made it.
In no case do not forget that for each work there is the most suitable tool for it ...