PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
kono
New Member
New Member


Joined: Jun 21, 2004
Posts: 2

PostPosted: Mon Jun 21, 2004 2:11 pm Reply with quote Back to top

Hello,

I'm currently in the middle of coding a large custom PHP-Nuke module (currently 75KB, may end up around 200), and I'm wondering what steps I can take to improve the loading time of pages in the module.

I see that I can break the module into separate files, and use the &file= URL parameter to access functions in those files. Before I go down that path, I'm wondering if anyone has tried this, and if it offered a noticeable performance improvement versus the monolithic approach.

Other than that, I'm wondering if anyone has any other optimization-minded tricks of the trade to share. This is my fourth custom module for my site, but I still consider myself quite the PHP rookie.

kono
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Mon Jun 21, 2004 2:23 pm Reply with quote Back to top

Well, as a general rule, anytime you include from other files you are incurring overhead, so that's not the way to go. What is causing the large size? Mostly static html or server side code?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
kono
New Member
New Member


Joined: Jun 21, 2004
Posts: 2

PostPosted: Mon Jun 21, 2004 2:41 pm Reply with quote Back to top

Raven wrote:
Well, as a general rule, anytime you include from other files you are incurring overhead, so that's not the way to go. What is causing the large size? Mostly static html or server side code?

I'm talking about something a little different than includes. The Addon_Sample folder contains an example of what I'm talking about.

You can have index.php and index2.php be part of the same module, and your URL has to look like "domain.com/modules.php?name=module_name&file=index2&op=..." to access functions in index2. You wouldn't include one from the other, so you can't actually call functions across the files, but if your module has multiple page traversals, and very little common code between them, it looks like you can break them down into discrete chunks.

I'm hoping this might eliminate a lot of overhead in my situation, which is a mildly complex database entry module with a couple dozen distinct pages. I have a couple pages which are just menus, maybe one query and a few echo statements, and I still see load times that exceed those of my forums.

I guess the real question I need to ask is this: When you navigate to "modules.php?name=module_name", the PHP engine has to parse all of index.php, and everything it includes, correct? Would limiting the amount of code per file yield any significant benefit?

kono
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum