Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ways to Improve Extremely Slow Codeigniter Website

I'm experiencing a very slow loading on my website.

At first I thought that maybe my code is slow, but after comparing my previous work to the same work, but migrating it to codeigniter I can say that the loading is now significantly slower.

Do you have any suggestion or ways to improve the performance of codeigniter?

like image 865
Cary Bondoc Avatar asked Jun 19 '14 08:06

Cary Bondoc


People also ask

How fast is CodeIgniter?

CodeIgniter – Performance & speed comparison CodeIgniter-based applications are run through a functional test to determine the performance. Few projects have also demonstrated various response times based on the number of users. For example, the average response time to run the application with 100 users was 11.5 sec.


2 Answers

improve the performance of codeigniter

Performance depends slightly on framework, CI itself is one of the fastest.

Your project performance mostly depends on your code, how you use PHP, how you create queries and maintain JS code.

Short answer to your question:

  1. CI active record class is garbage, use classic queries / alternative PDO.
  2. Use advantage of condition-loading helpers/modules
  3. Don't use security class functions unless it's necessary
  4. Study config files, there is much you can disable to speed up.

This can help, may not, best way to avoid performance problems is to study how languages work, for example you can get valuable performance info about PHP here.

like image 181
h.s.o.b.s Avatar answered Sep 22 '22 15:09

h.s.o.b.s


You can try this:
1. Compress HTML output, like this
2. Cache functions

$this->output->cache(60); // Will expire in 60 minutes


3. Enable Gzip Compression

$config['compress_output'] = TRUE;
like image 28
Abed Putra Avatar answered Sep 23 '22 15:09

Abed Putra