Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Controller performance in codeigniter

Is the maximum LOC(LINE OF CODE) effect on controller class response or not...is this thing matter..

 1.a)Controller: LOC 120, public functions exist 3.
   b)Controller: LOC 120, public functions exist 3.
   c)Controller: LOC 120, public functions exist 3.

 2.) Controller LOC 720, pubic function 10.
   it handle all the things in the same class.

Which one is better?

like image 591
Rahul Bajaj Avatar asked Nov 11 '22 14:11

Rahul Bajaj


1 Answers

Codeigniter has benchmarking tools built in. You can use that to determine which one is faster.

But if your application is slow, it is very unlikely to be the number of lines in a controller class or the number of methods. More likely it would be database queries, API calls, etc. In which case you should look into optimizing those things or cache the results.

You should organize your code in a way that makes sense and is easy to read while following the MVC pattern.

like image 179
Matthew Rapati Avatar answered Nov 15 '22 07:11

Matthew Rapati