CodeIgniter Forums
Can a lot of functions in one controller file slows down the whole thing? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Can a lot of functions in one controller file slows down the whole thing? (/showthread.php?tid=80837)



Can a lot of functions in one controller file slows down the whole thing? - sr13579 - 12-24-2021

Hello everyone,
I need to know something. Assume we put a lot of functions in controller for MVC. What is the best practice for system efficiency? Should I put them in different controllers or keep them inside one controller? Can putting so many functions in one controller class makes things slower?


RE: Can a lot of functions in one controller file slows down the whole thing? - InsiteFX - 12-24-2021

Yes it can make it slow down, but you would not really notice it with the speed of servers now days.

You can put them in a helper or or a class library, if they are for database access then place them into the model.