rfc:function_autoloading

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:function_autoloading [2013/08/30 12:19] – add performance section ircmaxellrfc:function_autoloading [2013/08/30 12:28] – add constant benchmark ircmaxell
Line 186: Line 186:
   * Proposal: average 0.000218 Seconds to call 1000 functions   * Proposal: average 0.000218 Seconds to call 1000 functions
  
-Therefore, there is no performance regression to normal function calls (defined functions).+ 
 +Therefore, there is no performance regression to normal function calls (defined functions). The margin of error for this test was on the order of +-0.00004 seconds. 
 + 
 +=== Constants === 
 + 
 +1000 constants were generated and placed in a single file. The following test script was used to test if there was any change to function call time for a defined function: 
 + 
 +<file php benchmark_constants.php> 
 +<?php 
 +require_once 'constants.php'; 
 + 
 +$start = microtime(true); 
 +for ($i = 0; $i < 1000; $i++) { 
 +        $name = 'test' . $i; 
 +        constant($name); 
 +
 +$end = microtime(true); 
 + 
 +echo "Completed in " . ($end - $start) . " seconds\n"; 
 +?> 
 +</file> 
 + 
 +  * Master: average 0.000228 Seconds to call 1000 constants 
 +  * Proposal: average 0.000221 Seconds to call 1000 constants 
 + 
 +Therefore, there is no performance regression to normal constant lookups (defined constants).
  
 ==== Userland Backwards Compatibility ==== ==== Userland Backwards Compatibility ====
rfc/function_autoloading.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1