crazy require_once optimization rears it head again.
Published 2007-07-14 10:14:51
There's been a long thread the last couple of weeks covering require_once and some rather crazy ideas to change the PEAR standards to do all sorts of strange things to load code up.
What is most ridiculus is the benchmarking that is being done to 'prove' that we should all move our code loaders to some 'allfiles.php' and we are magicially going to running be 15% faster.
What this whole concepts fails to put into place is loading all the PHP files up, either tiered one to another or all from one place is such a small part of a PHP page responding from a request.
Think of what is happening when you look at this page.
Only kidding... - but if you do this to a normal page, you would probably want to do the following
Working out how to remove a whole file or pre-process some bit of data would be a far better use of your time. And if you where running a team focusing on this you would probably have fired the guy who wasted all that time on such a pointless task as moving the require_once lines around.
Sounds like moving the deck chairs on the titanic?
What is most ridiculus is the benchmarking that is being done to 'prove' that we should all move our code loaders to some 'allfiles.php' and we are magicially going to running be 15% faster.
What this whole concepts fails to put into place is loading all the PHP files up, either tiered one to another or all from one place is such a small part of a PHP page responding from a request.
Think of what is happening when you look at this page.
- You start by looking at a bootstrapper (that sets config option) - probably quite quick as it just set's some variables.
- Then you run into the Framework class - that works out which file to load based on the URL you are typing. - This does quite a bit of text maniplation, making best guesses about where things might be. (this is quite generic and could be made specific to the application quite easily)
- We then do the page action stuff, like pulling data from databases which requires quite a few PEAR libraries. And does some really slow crap like connecting to databases and pulling data. This stage probably does far to many queries and pulls down to much data that it doesnt use.
- Then we do output stuff, Normally we are using a compiled template, (so we dont load all the template parsing code - well at least we save a bit of effort here). so we need to pull down at least the Flexy class, then the compiled template.
- replace it with a staticly generated page!!!
Only kidding... - but if you do this to a normal page, you would probably want to do the following
- reduce / remove database calls
- cache as much as possible.
- reduce / remove libraries needed and code used.
- move any data intensive code into C
- use an opcode cacher.
Working out how to remove a whole file or pre-process some bit of data would be a far better use of your time. And if you where running a team focusing on this you would probably have fired the guy who wasted all that time on such a pointless task as moving the require_once lines around.
Sounds like moving the deck chairs on the titanic?
Mentioned By:
google.com : april (104 referals)
www.planet-php.net : Planet PHP (87 referals)
google.com : require_once performance (76 referals)
google.com : december (73 referals)
google.com : apc require_once (56 referals)
google.com : require_once (54 referals)
google.com : php require_once performance (51 referals)
google.com : php require_once slow (50 referals)
google.com : require_once slow (40 referals)
google.com : php require_once (31 referals)
google.com : require_once overhead (22 referals)
google.com : php require_once overhead (20 referals)
google.com : php apc require_once (19 referals)
google.com : php require_once optimization (18 referals)
google.com : require_once php5 (15 referals)
google.com : php optimize require_once (14 referals)
google.com : require_once optimization (13 referals)
google.com : php optimization require_once (12 referals)
google.com : php require_once optimize (12 referals)
google.com : php performance require_once (10 referals)
google.com : april (104 referals)
www.planet-php.net : Planet PHP (87 referals)
google.com : require_once performance (76 referals)
google.com : december (73 referals)
google.com : apc require_once (56 referals)
google.com : require_once (54 referals)
google.com : php require_once performance (51 referals)
google.com : php require_once slow (50 referals)
google.com : require_once slow (40 referals)
google.com : php require_once (31 referals)
google.com : require_once overhead (22 referals)
google.com : php require_once overhead (20 referals)
google.com : php apc require_once (19 referals)
google.com : php require_once optimization (18 referals)
google.com : require_once php5 (15 referals)
google.com : php optimize require_once (14 referals)
google.com : require_once optimization (13 referals)
google.com : php optimization require_once (12 referals)
google.com : php require_once optimize (12 referals)
google.com : php performance require_once (10 referals)
Follow us
-
- Some thoughts on the language server and its usefulness in the roobuilder
- Roo Builder for Gtk4 moving forward
- Clustered Web Applications - Mysql and File replication
- GitLive - Branching - Merging
- PDO_DataObject Released
- PDO_DataObject is under way
- Mass email Marketing and anti-spam - some of the how-to..
- Hydra - Recruitment done right
Blog Latest
-
Twitter - @Roojs