📜 ⬆️ ⬇️

Kohana vs Codeigniter, Performance Synthetics

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:
CodeigniterKohana
one26,695914,808
226.604914,178
327,548714,289
four26,742713,845
five26.609914,554
626,564414,381
726,962213,717
eight26,882814,242
927.244513,771
ten26,851414,479
The average26.8714.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 enabled
Average (ms)Min (ms)Max. (ms)Throughput (queries / sec)Kb / s
3880249243702.557.17
3729253841052.659.5
3760260842632.659.04

Kohana 9 requests profiler enabled
Average (ms)Min (ms)Max. (ms)Throughput (queries / sec)Kb / s
2495110429903.927.62
2462123928733.927.89
248593329553.927.68

Codeigniter 9 requests, output 'ok'
Average (ms)Min (ms)Max. (ms)Throughput (queries / sec)Kb / s
3749277842412.60.01
3691218741112.60.01
3776304142082.60.01

Kohana 9 requests, output 'ok'
Average (ms)Min (ms)Max. (ms)Throughput (queries / sec)Kb / s
2451103528703.90.01
244599729243.90.01
2448126628833.90.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 ...

Source: https://habr.com/ru/post/49592/


All Articles