As it should be clear, when you use profiling, it is used to see how fast the aspects of the page are. Put this line in the main controller near the beginning (for example, in the constructor immediately after calling the parent constructor:
$ this-> output-> enable_profiler (TRUE),
This will print a large amount of profiling data at the bottom of your resulting page. This will include all database queries, how long it will take and how much time has passed in the controllers (PHP time as opposed to database query time).
If something starts slowly by turning on the profiler and checking if it is a controller or requests (or both). If these are database queries, then you need to improve them and that is the topic itself. If these are controllers, then you need to figure out which code is causing the slowdown.
Read https://ellislab.com/codeigniter/user-guide/libraries/benchmark.html and start placing benchmark start and stop tags, where you think it might cause slow speeds, loops and any recursive functions are the first places. which you should check. After you find the slow code segment, you need to find how to choose it, which again is a whole worm of worms.
It is possible that slow speeds are associated with poor equipment, a busy server, a slow connection, or a ton of other problems, but they are not within the scope of this issue.
Edit: I just want to add that you are not using the capabilities of the CI profiler or benchmarking to improve speed, only to find where speed should be improved. I know this is a trifle, but I just thought that I should point it out.
Sid
source share