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.

    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:
     CodeigniterKohana
    126,695914,808
    226,604914,178
    327,548714,289
    426.742713,845
    526,609914,554
    626,564414,381
    726.962213,717
    826.882814,242
    927.244513,771
    1026.851414,479
    Average26.8714.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
    3880249243702,557.17
    3729253841052.659.5
    3760260842632.659.04

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

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

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

    Also popular now: