Why does Codeigniter do so well in benchmarks even if it doesn’t follow the language standards?

Asked

Viewed 747 times

10

I see many people spitting on Codeigniter, saying that it is a framework junk that refuses to follow the "language patterns". But I find it strange to say this of the framework that has the best performance among those that are not compiled as we can see in the benchmarks below

Benchmark de requisições por segundo

Benchmark of requests per second


inserir a descrição da imagem aqui

Response time benchmark


Font: Dev-Media

I took this source consideration as it presents the versions of the tested frameworks and is one of the few that takes into account the Codeigniter 2.

Observing: Phalcon stands out so much from other frameworks by the fact that it is written in C, pre-compiled and used as server extension, which takes away virtually all the overhead that frameworks of interpreted languages usually have. Thank you @Kazzkiq

  1. What makes Codeigniter perform so superior to others?

  2. Who’s really wrong, Code Igniter for not following the "language patterns" or the patterns that are causing unnecessary overheads in other frameworks?

Note: It is important to remember that PHP was created to be procedural, having OO implemented in its version 5 and keeping the possibility of being written in procedural form, but using OO in php generates an overhead as can be seen in that reply

  • Place the source or link from which this data came

  • @rray added

  • 3

    The article is from Devmedia, but the benchmarks are from the Phalconphp framework documentation, that the title of curiosity, stands out so much of the other frameworks by the fact that it is written in C, pre-compiled and used as server extension, which takes out practically all overhead that frameworks of interpreted languages usually have.

  • @Kazzkiq I left this information kind of implicit, but I will add to better exclaim the difference between them

  • 1

    @Rodrigoborth the other frameworks lose in performance but gain in maintenance and readability of code. Even better performance than codeigniter is possible if you don’t use any framework and make things to measure.

  • 4

    Following standards doesn’t mean better computational performance. Standards are for other programmers to better understand your code (or for you to understand it yourself).

  • @gmsantos yes, I know that, however, the code Igniter leaves nothing to be desired in code readability or in maintenance speed, in fact it has advantage in these two points also over other frameworks, that is what raises my doubt, if use OO prodrões, in a language originally procedural, is right or not?

  • @Oeslei in the case of PHP we have a difference between other languages because it is, in its essence a procedural language, and the patterns induced OO, which causes a great overhead in the language. Even so, Code Igniter that does not follow these standards can have a higher readability and easier and faster maintenance compared to other frameworks. Which begs the question, these patterns were thought in favor of php or were thought in favor of language being seen as equal to others?

  • @Rodrigoborth the focus of frameworks and the PHP language is not performance. This has been changing little since version 5.4 (the tests were based on version 5.3) by the pressure of frameworks like Phalcon, HHVM. One thing is certain: Codeginiter has stopped in time. Currently it is still in version 2.x, while the other FW have evolved with language. I would like to see this same Benchmark with the current versions of the Fws in question... possibly this difference would decrease dramatically.

  • @gmsantos code Igniter is releasing its version 3.x, is still unstable, but who used said that the difference in performance for version 2 is quite large. I believe that this distance can increase even more in the next benchmarks. I still have no reference to the current benchmark, I believe that the 5.x version of php is the problem, as it is the transition version between procedural and OO

  • Although it doesn’t seem like it, there is a chasm between PHP versions 5.2, 5.3 and 5.4 (should reach a 4-year window in total). Another fact, Codeigniter is object-oriented.

  • @gmsantos yes, I know he is OO, however, look at the way he uses OO and how other frameworks use OO’s the impression that are different paradigms being used

  • I found a second Benchmarking a little more recent. In it the Codeigniter loses to Kohana and Slim. In the same answer posted as reference note I found the phrase "Worrying about performance using PHP doesn’t make sense." and it really doesn’t. Worth reading: http://stackoverflow.com/a/16697154/2099835

  • @gmsantos looked at the benchmark, I remember seeing a similar benchmark, with very similar results, but they were using CI version 1.7. In this I could not locate which version of the frameworks used

  • php quick? ops...there’s something wrong there, kkk

Show 10 more comments

1 answer

4

Codeigniter is not and has never been "a framework junk". He is simply from a time when "language patterns" was the last thing a PHP developer had in mind.

Codeigniter is faster by having fewer strings and having fewer abstractions.

Writing patterns in a given language serve to facilitate code reading, program extension, maintenance, and testing. Most of the time it is not directed to performance.

Codeigniter is a solid framework with great documentation and good performance. Who has always used CI, do not need to let go, although I recommend using Laravel for new projects or for beginners, because it will force the learning of best practices in the development of PHP applications.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.