note 55001 added to function.fpassthru

From: Date: Fri, 22 Jul 2005 03:08:48 +0000
Subject: note 55001 added to function.fpassthru
Groups: php.notes 
Request: Send a blank email to php-notes+get-92270@lists.php.net to get a copy of this message
readfile and fpassthru are about 55% slower than doing a loop with "feof/echo fread". I did an apache benchmark on Linux using PHP to read-and-show a 4MB JPG on browser and here are the results: * Concurrency Level: 200 * Complete requests: 1000 * Document Length: 4646204 bytes * Requests per second: - direct request to JPG: 72.07 - fpassthru: 11.28 - fread: 20.33 - readfile: 11.84 * Concurrency Level: 200 * Complete requests: 1000 * Document Length: 4646204 bytes * Requests per second: - direct request to JPG: 64.44 - fpassthru: 6.84 - fread: 19.45 - readfile: 8.76 If reading thru PHP is needed, I suggest using fread. If you can bypass PHP and do direct linking, than it's prefered. ---- Manual Page -- http://www.php.net/manual/en/function.fpassthru.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55001 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55001&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55001&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55001&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55001&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55001&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55001&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55001&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#92270) next »