News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SeeIT.com:
The include() include_once() performance debate
June 11, 2010 @ 12:42:44

From the SeeIT.org blog today there's a new post rehashing an old topic that pops up from time to time in the PHP community - the include vs include_once performance debate.

The conventional wisdom always said that PHP's include()/require() was quicker than include_once()/require_once(), but recently I came across an interesting post by Arin Sarkissian which suggests otherwise. [...] So in keeping with the spirit of quick and dirty experimentation I hacked up some code and ran some tests on include()/require() against include_once()/require_once() and on the relative/absolute path issue. The results are pretty surprising and I love to hear some views.

He includes the testing methodology consisted of creating 10,000 files with a simple variable assignment in them and a loop to run through all of them to record the time (as reported by microtime) switching out the different times of inclusion each time - include, include_once, require, require_once. You'll have to visit the post yourself to see the results of the tests. There's charts and tables showing the differences in results based on things like using APC and PHP4 versus PHP5.

1 comment voice your opinion now!
include includeonce performance debate benchmark


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Webinars: Upcoming Zend Webinars (Zend Server, Magento, Performance, IBM i)

Phil Sturgeon: Benchmarking Codswallop: NodeJS v PHP

Kore Nordmann's Blog: Comparision of PHP image libraries

Gonzalo Ayuso's Blog: Performance analysis fetching data with PDO and PHP.

Evert Pot's Blog: iconv_substr vs mbstring_substr


Community Events





Don't see your event here?
Let us know!


tips framework api voicesoftheelephpant list release zendserver deployment bugfix podcast laravel introduction community conference series developer symfony language interview library

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework