Re: Script's length, echo, and execution speed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Casey Chu wrote:
Yeah, try testing. Maybe something like this:
<?php
$form = "<form action=' ' method='post'><textarea
name='code'></textarea><br /><button
type='submit'>Execute</button></form>";
if ($_POST['code']) {
 echo "<div style='border: 1px'>";
  $time_start = microtime_float();
  eval($_POST['code']);
  $time_end = microtime_float();
 echo "<br />Loading took: ". $time_end - $time_start. '</div>';
 }
echo "<div style='float: left'>$form</div>";
// Note: This script is extremely dangerous and is not tested.
?>
I haven't been following this thread, so I don't know if this has been suggested...

If you can run a local server, IMO, xdebug is *the* way to go...xdebug2 has an excellent profiler built-in. You can use kcachegrind or wincachegrind to see some pretty mind-boggling detail about where your performance goes. It's much easier than inserting timing statements into existing code.

jon

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux