note 64415 added to function.call-user-func
| From: | Maresa at osu1 dot php dot net | Date: | Thu, 13 Apr 2006 22:41:48 +0000 |
| Subject: | note 64415 added to function.call-user-func | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-108018@lists.php.net to get a copy of this message | ||
I tested the same code that insta at citiesunlimited dot com pasted on the following machines:
www1 machine:
OS: FreeBSD 5.2.1-RELEASE
CPU: 2 x Intel(R) Xeon(TM) CPU 2.66GHz (2657.82-MHz 686-class CPU) with Hyperthreading
MEM: 1073217536 (1023 MB)
PHP 5.1.2 (cli)
PHP 4.4.1 (Web)
www2 machine:
OS: Linux version 2.6.14-gentoo-r5 Gentoo 3.4.3-r1, ssp-3.4.3-0, pie-8.7.7)
CPU: 2 x Dual Core AMD Opteron(tm) Processor 265 stepping 02 1808.357 MHz
MEM: 2060388k total
PHP 5.1.2 (cli)
PHP Version 4.4.0-pl1-gentoo (web)
dev machine:
OS: Linux version 2.6.15-gentoo-r1 Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1
CPU: Intel(R) Pentium(R) 4 CPU 2.00GHz stepping 04
MEM: 516384k total,
PHP 4.4.0-pl1-gentoo (cli)
PHP Version 4.4.0-pl1-gentoo (web)
The result are as follows:
www1 - CLI
Variable functions took 0.012186050415 seconds.
call_user_func took 0.0300550460815 seconds.
eval took 0.17235994339 seconds.
www1 - Web
Variable functions took 0.017616 seconds.
call_user_func took 0.034926 seconds.
eval took 0.149618 seconds
www2 - CLI
Variable functions took 0.0065491199493408 seconds.
call_user_func took 0.019452095031738 seconds.
eval took 0.10734891891479 seconds.
www2 - Web
Variable functions took 0.01565 seconds.
call_user_func took 0.02613 seconds.
eval took 0.132258 seconds.
dev - CLI
Variable functions took 0.025176 seconds.
call_user_func took 0.047402 seconds.
eval took 0.168196 seconds.
dev - Web
Variable functions took 0.025465 seconds.
call_user_func took 0.049713 seconds.
eval took 0.20154 seconds.
On www1 - CLI, eval is about 14 times slower than calling function by using variable.
On www1 - Web, eval is about 8.5 times slower (hmm interesting. Perhaps PHP4 is faster calculating
eval than PHP5)
On www2 - CLI, eval is about 16 times slower than calling function by using variable.
On www2 - Web, eval is about 8.5 times slower (about same result as www1)
On dev - CLI, eval is about 6.6 times slower than calling function by using variable.
On dev - Web, eval is about 8 times slower (about same result as www1)
On the dev machine, CLI and web version of PHP is the same. and their speed difference between
calling function using variable or eval does not differ that much compare to PHP5 VS PHP5
----
Server IP: 66.163.161.117
Probable Submitter: 67.126.148.190
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.call-user-func.php
Edit -- http://master.php.net/note/edit/64415
Del: integrated -- http://master.php.net/note/delete/64415/integrated
Del: useless -- http://master.php.net/note/delete/64415/useless
Del: bad code -- http://master.php.net/note/delete/64415/bad+code
Del: spam -- http://master.php.net/note/delete/64415/spam
Del: non-english -- http://master.php.net/note/delete/64415/non-english
Del: in docs -- http://master.php.net/note/delete/64415/in+docs
Del: other reasons-- http://master.php.net/note/delete/64415
Reject -- http://master.php.net/note/reject/64415
Search -- http://master.php.net/manage/user-notes.php