gwmbox
02-13-2011, 08:12 AM
Hi, can I ask as per the title does the number of php elements in a page affect the performance of the pages load time and the servers CPU usage?
I have a template I am building for a joomla site that will only load sections of the page to be viewed if there is content to be viewed in that section, at the same time the width of the sections will change depending on some settings variables and if other sections have content or not... I hope that makes sense.
Now the code for the entire page gets quite long when you add all the checks to see if something has content or not and also the calculations to work out what to and what not to show and what style class to set to some of the sections to determine width etc.
What I want to know is if the code I have would cause any cpu load issues at all.
I'd appreciate anyone giving advice for tidying it up, maybe giving me help to improve the code a little and ensure it loads with the least amount of CPU use as possible. My knowledge of php is low but I am learning, so I am sure that from what I have someone will be able to optimise it further and make it run faster.
Oh and also the top part which looks at the number of modules in a row and where there is 3 I have set it to be 99/3 and not 100/3, anyone have an idea how I can add the 1% back on to the middle module so I can have 33% 34% and 33% if there are 3 modules in a row?
Attached is the html/php and main css as txt files if you have time to review and make comments on them :)
Cheers
GW
I have a template I am building for a joomla site that will only load sections of the page to be viewed if there is content to be viewed in that section, at the same time the width of the sections will change depending on some settings variables and if other sections have content or not... I hope that makes sense.
Now the code for the entire page gets quite long when you add all the checks to see if something has content or not and also the calculations to work out what to and what not to show and what style class to set to some of the sections to determine width etc.
What I want to know is if the code I have would cause any cpu load issues at all.
I'd appreciate anyone giving advice for tidying it up, maybe giving me help to improve the code a little and ensure it loads with the least amount of CPU use as possible. My knowledge of php is low but I am learning, so I am sure that from what I have someone will be able to optimise it further and make it run faster.
Oh and also the top part which looks at the number of modules in a row and where there is 3 I have set it to be 99/3 and not 100/3, anyone have an idea how I can add the 1% back on to the middle module so I can have 33% 34% and 33% if there are 3 modules in a row?
Attached is the html/php and main css as txt files if you have time to review and make comments on them :)
Cheers
GW