Welcome Guest, Not a member yet? Register   Sign In
JSON encoding test at TechEmpower, CodeIgniter vs PHP.
#1

The most beautiful thing about CodeIgniter is its performance comparing to other PHP web frameworks.

TechEmpower published round-11 of web frameworks' performance benchmarks. Two of the benchmarks comparing Raw PHP and CodeIgniter showed big difference in the performance.
single-query (even if the raw queries were used without the Active-Record or any ORM) and json-serialization.
The reason for the slow performance for single-queries (as I read their code used for the tests) was the use of CodeIgniter-2 (but a bigger reason was) and using mysql driver in CodeIgniter and for PHP they used PDO driver (I reported that issue).

For the JSON serialization I read the method "set_content_type" inside the Output class, but I don't know why it is this much slow comparing to raw-php. Can anyone tell me why does this function run slower comparing to the raw-php code?
Reply
#2

> The reason for the slow performance for single-queries (as I read their code used for the tests) was the use of CodeIgniter-2 (but a bigger reason was) and using mysql driver in CodeIgniter and for PHP they used PDO driver (I reported that issue).

Did you confirm that? If you change it to PDO_MySQL, the performance increases?

> Can anyone tell me why does this function run slower comparing to the raw-php code?

Every framework is slow. It does a lot of things before running code in controllers.
Reply
#3

(This post was last modified: 12-02-2015, 02:52 PM by cartalot.)

thank you so much for posting this!! made my day. Codeigniter today is way way faster then any other php framework besides Phalcon,
and it could be argued Phalcon is not a php framework because its compiled.

Nov 23 2015 benchmark comparisons of only PHP frameworks:
https://www.techempower.com/benchmarks/#...ne&l=a58g0
Reply
#4

(12-01-2015, 11:00 PM)kenjis Wrote: > The reason for the slow performance for single-queries (as I read their code used for the tests) was the use of CodeIgniter-2 (but a bigger reason was) and using mysql driver in CodeIgniter and for PHP they used PDO driver (I reported that issue).

Did you confirm that? If you change it to PDO_MySQL, the performance increases?

> Can anyone tell me why does this function run slower comparing to the raw-php code?

Every framework is slow. It does a lot of things before running code in controllers.

They are using raw queries inside CodeIgniter, so if the overhead of query builder class isn't added, queries should perform the same or with a minor difference. If still there is huge difference, the reason possibly could be the database driver used, which is mysql driver in that case.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB