Welcome Guest, Not a member yet? Register   Sign In
Could Memory Usage of CI reduced?
#1

[eluser]rahendz[/eluser]
first, sorry for my bad english. i'm using CI v3 and start from begining, i start the welcome page. nothing edited or built yet. and the memory usage show 2.6MB. i assumed that if i started built application the memory will increase, is there any ways to reduce it, minimalize the memory usage? or a hack maybe? just curious :3
#2

[eluser]CroNiX[/eluser]
I don't believe so. Maybe just make sure you aren't loading things where they aren't actually needed (like autoload loads things for each request whether you utilize it or not). CI actually has one of the smallest memory footprints of any a framework. All frameworks take more overhead than straight php. Try benchmarking the same thing in another framework and it will most likely use more memory than CI does. 2.3MB is actually a very small footprint. Yes it will grow as you start actually coding your app depending on what you are doing, how many classes you are loading/using, how much data you are working with, how many db calls you are making, how many loops you are iterating over data, etc.

Most frameworks are loading a lot more things than CI is, which is why they consume more resources.
#3

[eluser]rahendz[/eluser]
ok, thanks reply. so autoload are not recommended for use? awesome. when i use CI v.2 i always develop with autoload all the time LOL
#4

[eluser]CroNiX[/eluser]
I autoload things like database, url helper, etc. Things that are used in just about all controllers...
#5

[eluser]InsiteFX[/eluser]
The only libraries I autoload are the database and sessions.

For helps I autoload the url_helper and my custom asset_helper.

everything else is loaded when needed.
#6

[eluser]ivantcholakov[/eluser]
2.6MB memory usage is fine. On the other hand, the name of the configuration file "autoload.php" maybe is misleading for newcomers. Everything declared there loads immediately.

CodeIgniter 3 has the minimal required version 5.2.4 for PHP. This means the SPL (standard PHP library) is always available. spl_autoload_register() and related functions will be always available. I wonder then whether it is good for CodeIgniter to provide code/a way for lazy auto-loading of classes. I have my implementation, but I restrained myself to talk about such a feature, because I wait the release. Although coding is easy, such a feature needs some discussion. Some standard is needed.




Theme © iAndrew 2016 - Forum software by © MyBB