Php codeigniter中的控制器性能

Php codeigniter中的控制器性能,php,codeigniter,micro-optimization,lines-of-code,Php,Codeigniter,Micro Optimization,Lines Of Code,最大LOC(代码行)是否对控制器类响应产生影响…这件事重要吗 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 t

最大LOC(代码行)是否对控制器类响应产生影响…这件事重要吗

 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.
哪一个更好?

Codeigniter内置了工具。您可以使用它来确定哪一个更快

但是如果您的应用程序很慢,那么控制器类中的行数或方法数就不太可能是问题所在。更有可能是数据库查询、API调用等。在这种情况下,您应该考虑优化这些内容或缓存结果


在遵循MVC模式的同时,您应该以一种有意义且易于阅读的方式组织代码。

我认为第一种方式比第二种方式更快,所以第一种方式