note 88237 deleted from function.eval by danbrown
| From: | danbrown@php.net | Date: | Fri, 16 Jan 2009 18:26:03 +0000 |
| Subject: | note 88237 deleted from function.eval by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-149329@lists.php.net to get a copy of this message | ||
Note Submitter: trucex-gmail-nospam
----
Re: alexis at amigo dot com
1) In your script you time things in seconds instead of milliseconds. That's not nearly as
accurate, which isn't so good for benchmarking.
2) Because eval is a language construct and that the code inside it must be parsed by PHP, I'm
pretty sure that it will be cached much in the same way a stored MySQL query would. In effect, PHP
has already parsed the code you are passing to eval and simply substitutes the variable, resulting
in very fast execution in a loop.
Therefore, testing the same statement executed several million times is hardly a proper benchmark
for it.
3) More as a note than anything, include reads from the disk. There is a certain amount of delay
associated with that as I'm sure you know. Your benchmark isn't going to be indicative of
a benchmark run on a server with high performance SCSI drives, I'd be willing to bet.
4) The code you execute in your eval and included file aren't really substantial enough to call
it a full benchmark. Include may well be faster than eval if you have a notably long or complicated
routine and you are only executing the code a single time. There's also the possibility of
having a very fast SSD or even USB disk on the system and writing the temporary include files out to
that to improve the performance when reading them back in.