rfc:autoload_classmap

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:autoload_classmap [2021/03/19 18:36] marandallrfc:autoload_classmap [2021/04/06 05:32] (current) marandall
Line 31: Line 31:
   * Always check the classmap first if it is set.    * Always check the classmap first if it is set. 
   * (If Found) Trigger a TypeError if the key's associated value is not a string.   * (If Found) Trigger a TypeError if the key's associated value is not a string.
-  * (If Found) Use the REQUIRE_ONCE mechanism. +  * (If Found) Use the REQUIRE mechanism. 
   * (If Found) Trigger an Error if the relevant class is not defined after including the file specified in the classmap.   * (If Found) Trigger an Error if the relevant class is not defined after including the file specified in the classmap.
  
Line 38: Line 38:
 ===== Performance ===== ===== Performance =====
  
-Testing suggests that running through an internal classmap delivers 5% performance increase vs a userland function call (e.g. composer). +Testing suggests that autoloading through an internal classmap delivers around 5% performance increase vs a userland function call (e.g. composer). 
  
 This is 5% of the cost of the autoloading, and not the execution as a whole. Testing was performed by creating 50,000 empty classes each in an individual file, and then autoloading every one of them in a loop. Amount of classes was purely to help reduce noise. This is 5% of the cost of the autoloading, and not the execution as a whole. Testing was performed by creating 50,000 empty classes each in an individual file, and then autoloading every one of them in a loop. Amount of classes was purely to help reduce noise.
rfc/autoload_classmap.1616179019.txt.gz · Last modified: 2021/03/19 18:36 by marandall