PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 4th, 1999, 03:40 AM
Tsjakoe
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Hmm i was just wondering..

What processes faster ?
one big php3-file or a few smaller ones ?

Is there also a difference in cpu usage ?

thnx in advance..

Reply With Quote
  #2  
Old December 8th, 1999, 10:26 PM
Darguz
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
As a matter of fact, I just finished some testing on this. I created a script with 60 conditional blocks consisting of 20 echo statements each, and set the conditions to execute 50 of them. In one version of the script, the code was all in one file. In the second version, each conditional block include()ed its 20 echo statements, each from a different file.

I ran each script ten times through the time utility under FreeBSD Unix.

Inline:
0.987 real 0.112 user 0.007 sys

Includes:
1.138 real 0.106 user 0.007 sys

It appears the inline method executes a little faster but uses more CPU time. Please note that this is not very thorough testing.

------------------
Alan Little
Holotech Web Design
www.holotech.net/


Reply With Quote
  #3  
Old December 9th, 1999, 09:49 AM
rod k
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Makes sense. It would take fewer cycles as the interpreter only has to parse the actual files that get included, so using conditional includes saves on parse time. But it takes longer overall because you are doing more filesystem access.

Reply With Quote
  #4  
Old December 9th, 1999, 10:06 AM
Tsjakoe
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Hmm..

How does php3 parse a file ?
Is it realy parsing all functions or only
the ones it needs ?


Reply With Quote
  #5  
Old December 9th, 1999, 10:58 AM
rod k
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I'm not sure what you mean by "all functions". It parses an entire script. However, if you conditionally include a script (ie. if(some_condition){include(file)} then the included file is only parsed if the condition is true. Whereas if you require() a file then it is added to the script before parsing and executing.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > What is the best sollution ?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap