![]() Topic awaiting preservation: PHP Script performance (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Australia |
![]() Hey, |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() A script with less functions does run faster. |
Paranoid (IV) Inmate From: Australia |
![]() Okay thanks, |
Paranoid (IV) Inmate From: Australia |
![]() Actually lets say do do require_once on a file with a class and functions. Is that compiled even if you dont create an object of that class? |
Bipolar (III) Inmate From: |
![]() Yes, it's parsed into memory, even if you never instantiate or call anything in that file. Once you include the file (include/require/include_once/require_once) it gets pulled into memory and parsed. So it is a good idea to split up large classes and libraries. |
Paranoid (IV) Inmate From: Australia |
![]() Thanks i will have a read |
Bipolar (III) Inmate From: |
![]() I considered that maybe something wasn't clear. Including a file only occurs when that code is executed ... so in this (very simple) example: code: $x = "a"; if($x == "a") { require_once("a.php"); } else { require_once("b.php"); }
|
Paranoid (IV) Inmate From: Australia |
![]() Yeh i figured as much, did some testing anyways and most of my scrpipts execute in under 0.05 seconds so its all good for now. The only slow ones are due to ftp operations which seem to be slow by nature. |