2013-05-10, 07:24 AM
Hi All,
Just wondering some thoughts again here.
I am writing a plugin all coming through misc.php in the plugin file I have several different functions, ive barely scratches the surface of the plugin front-end at the moment and the file is starting to push 20kb. Now I know that doesn't sound a lot, however this will at least double by the time I am done if not go up to 100Kb.
Again that isn't huge, but I am wondering what size files people like to keep their plugin too, theoretically the entire plugin file gets called with myBB on each load so it has to load the entire 100kb file, it doesn't take many of these before you start hitting an MB of additional load.
As such I am thinking it may be worth splitting this into conditional includes. It isn't the tidiest method of handling stuff I will admit and is fairly over the top when a lot of the functions are only a few lines, however at what point do you guys start conditionally including to make this smaller rather than loading big files and at what point is that just over the tops and annoying for maintenence.
I am going to split the install SQL into a different file, as well as the template stuff, because that is information that only ever needs to be called at very select times and not every time the system loads. That should lighten things up a lot.
However thought this was worth a discussion.
I by no means don't want to write a php file or every function, but certainly for smaller groups of it, so each load should theoretically be only 10Kb or so at most.
Is it even worth bearing any thought?
Dan
Just wondering some thoughts again here.
I am writing a plugin all coming through misc.php in the plugin file I have several different functions, ive barely scratches the surface of the plugin front-end at the moment and the file is starting to push 20kb. Now I know that doesn't sound a lot, however this will at least double by the time I am done if not go up to 100Kb.
Again that isn't huge, but I am wondering what size files people like to keep their plugin too, theoretically the entire plugin file gets called with myBB on each load so it has to load the entire 100kb file, it doesn't take many of these before you start hitting an MB of additional load.
As such I am thinking it may be worth splitting this into conditional includes. It isn't the tidiest method of handling stuff I will admit and is fairly over the top when a lot of the functions are only a few lines, however at what point do you guys start conditionally including to make this smaller rather than loading big files and at what point is that just over the tops and annoying for maintenence.
I am going to split the install SQL into a different file, as well as the template stuff, because that is information that only ever needs to be called at very select times and not every time the system loads. That should lighten things up a lot.
However thought this was worth a discussion.
I by no means don't want to write a php file or every function, but certainly for smaller groups of it, so each load should theoretically be only 10Kb or so at most.
Is it even worth bearing any thought?
Dan