Categories
- BLOG -

Reducing WordPress’ Big-O Complexity

WordPress’ core loads and compiles ~2000 PHP functions and 90 classes on each page request. So the next time you load your WordPress powered homepage that’s how many PHP functions and classes are being compiled and executed (appropriately) to show you the contents you see.

Now keep in mind, all this is only the server application layer we’re talking about; there is also the front-end and network layer processing times that are a separate story.

That’s why WordPress websites tend to not be the fastest (eerily reminding some of Java apps).

There are many good solutions in the market to help cache and distribute WordPress elements that no doubt help make WP applications much faster. However, one aspect of optimization that no one successfully tried is reducing the Big O time and space complexity of WordPress.

The above mentioned 2000 + 90 PHP functions and classes that are loaded and compiled on each page request are not all required for a successful page load. Our testing found only 600 procedural PHP functions being called from the 2000 on a typical page request.

This is where WordPress AutoLoader comes in. We believe that a WordPress software running with WP AutoLoader enabled will have a noticeable change in the Big O formula for a WordPress page load. Leading to time and (signifiant) processing load savings.

How it Works

WP AutoLoader enables lazy-loading on both procedural PHP functions (all 2000 of the WP core) and PHP classes (all 90 of them).

For those aware of the fact that autoloading is not possible with procedural functions in PHP; you should know we replace the original function definitions with empty shells that call the code only when the function is actually used.

Our team did careful testing to balance out the time it takes to load additional PHP include files with the time to process un-needed code and came up with a boot strap of ~600 functions that are pre-loaded, allowing for maximum speed and optimal memory savings.

We hope you will agree that WP AutoLoader is a valuable addition to the WordPress community; helping enterprise grade WP software optimize on a level not possible before.