Cleaning up WordPress to improve performance?

You are acting on awfully big assumption that something like that would improve performance. Spoiler — no, it won’t.

The load process in very loose terms consists of:

  1. Optionally running code responsible for looking up definitions (autoload or custom).
  2. Parsing the file or retrieving results from opcode cache.
  3. Loading results to be used.

The “autoload is fast” is popular fallacy. Foremost autoload is convenient. It is can actually slow things down in practice because processing the files is hugely improved by opcode cache, but repeatedly locating those files (step 1) can only be optimized so far and adds up very fast.

Would WordPress core benefit from better organization and autoload of classes? Certainly, that is however not happening because it’s developed on premise of not using that feature of PHP.

But “converting” functions to autoloaded classes? My educated guess this would ruinous to performance, while trying to optimize part of process that isn’t bottle neck in first place (in current state of core code/load).

Leave a Comment