I am currently working on a social community website (that could become very popular) and the homepage (most database intensive page) loads in 0.13s (7pages/second). This is a great improvement due to the new PC I have bought (AMD Athlon64 X2 4000+, 2GB 800MHz DDR2 RAM, WD2500YS SATA HDD). The old PC was generating only 3 pages/second (AMD Athlon XP 2200+, 896MB 400MHz DDR RAM, IDE HDD). I assume on a dedicated server with MySQL query caching and maybe APC or some other caching sistem for the scripts will deliver much more pages/second). The CI internals load in 0.02 seconds on my new PC. That means about 50+ pages/second for a “hello world” controller.
Leaving the hardware and cache optimization aside, CI does lots of stuff in an unoptimized manner. Yes, it is way faster than any other framework but improvements could be done.
First of all I want to point out something that I discovered and I would have not anticipated. In a framework a great time is spent including files. If you include just a few files (let’s say 5 files) it’s fast, but if you want to include 50 files you will notice it takes a lot of time. I did a benchmark on including 20 php files that each contained a class and it took much more time than i would have thought (0.03s). CI loads lots of files. There are the config files, library files, view files (which could be many), etc. They all add up and slow things down.
Other things that are slower than they could be are the variable retrivals. Doing $this->config->item(‘base_url’); instead of $config[‘base_url’] is slower. Personally I also find it annoying to tipe that much to get a config value.
Using CI ActiveRecord class to generate queries is also slower than just building your query in a string. But it has it’s advantages also 😊
Personally the routing feature is a bit of overkill since we can use .htaccess and mod_rewrite for that (for those who can’t i suggest you find a real host 😛).
Happily CI is overall very helpful and I can live with those things that I don’t like. Also in real life most of the sites we build are not so popular to have to handle a huge ammount of requests. I read once that del.icio.us is built on top of Symfony (which is SLOW SLOW SLOW) so I guess if one of my sites will ever get that popular it won’t be too hard to modify CI to handle the requests.
newbie, please let me know when you finish with the modifications. I would like to see what improvments you have done.