CodeIgniter Forums
How To Optimise Controller Execution Time - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12)
+--- Thread: How To Optimise Controller Execution Time (/showthread.php?tid=82167)



How To Optimise Controller Execution Time - futurewebs - 06-20-2022

Hi All,
Im trying to improve performance of an ap I created and at the moment looking into how best to improve Controller Execution Time.
I know the first thing would be to make sure Im not auto loading any libraries etc that are not relevant.
I also read that not posting the .php extension when calling a view file might help. Whats anyones view on that ? How would that help and if it does how much an improvement might we see.
Most page load up in less that 0.5
I would love to hear your tips and advice.


RE: How To Optimise Controller Execution Time - includebeer - 06-23-2022

Don't waste time on micro optimization. Find where the most time is spent and improve this part. Most of the time, the bottleneck will be the database queries. 

After you have optimized your database, you can also use Web page caching and Caching driver to improve performance.


RE: How To Optimise Controller Execution Time - InsiteFX - 07-12-2022

You can also turn on php's Op Cache which will speed up your whole app.


RE: How To Optimise Controller Execution Time - kenjis - 07-12-2022

CI4 has Timer.
See https://codeigniter4.github.io/CodeIgniter4/testing/benchmark.html#using-the-timer