Measuring plugin impact on WordPress performance
Arūnas Liuiza, Mantas Poška, Iveta Rimkutė
- WordPress is a very popular platform (27.8% market share);
- Almost 50.000 plugins available;
- Performance is important:
- 3 second rule
- 1 second!
- 0.5 seconds - „instant“
- How plugins impact WordPress performance?
- One of the most popular WordPress plugins.
- A contentious issue in WordPress Community ;)
- Some people hate it, others swear by it.
- Everybody has an opinion about it.
- WordPress 4.6.1
- Jetpack 4.3.2
- Twenty Sixteen 1.2
- LEMP stack:
- Ubuntu 14.04.4 LTS
- nginx 1.4.6
- PHP 5.5.9
- MariaDB 5.5.47
- Digital Ocean droplet
- 1GB RAM
- 1 CPU
- 30GB SSD
- Nothing else running on it
- From Wikipedia
- All countries
- All capitals
- Some cities
- 600+ posts in total
What was measured?
- Peak Memory Usage
- PHP Execution Time
- SQL Read Query Count
- SQL Write Query Count
- SQL Execution Time
- Local Script/Style Request Count
- Remote Sricpt/Style Request Count
- Remote HTTP GET Request Count
- Remote HTTP POST Request Count
How was it measured?
- A custom lightweight plugin
- Hooking in at 'shutdown' hook
- Loading home page 9 times
- Discard min and max values and count the average of remaining 7.
- Activated Jetpack:
- +0.47 Mb / +14.11%
- Activating a single Jetpack module:
- +0.76 Mb / +22.82% on average
- +0.69 Mb / +20.72% for Infinite Scroll (min)
- +1.09 Mb / +32.73% for Sharing (max)
Activated Recommended modules:
- +2.04 Mb / +61.26%
- Activated All modules:
- +2.451 Mb / +73.57%
All figures are relative to fresh WP install (3.33 Mb of peak memory usage)
- Jetpack adds +0.076 s of load time on average.
- Big variations in results (+- 30%), so a bigger sample is needed for more reliable results.
All figures are relative to fresh WP install (0.1848 s execution time)
- Activated Jetpack
- +1 read query
+2 read queries
- Related posts, Custom CSS
+3 read queries
- Extra Widgets, Infinite Scroll
+7 read queries
- Recommended modules
+10 read queries
- All modules
- WordPress loads
- 6 internal scripts, 5 internal sytles, 1 external style
- Recommended modules add
- +1 internal, +1 external script, +2 internal styles
- All modules add
- +11 internal, +2 external scripts, +11 internal styles
- Culprit modules
- Infinite Scroll ( +5/0/+6)
- Gravatars ( +1/+1/0)
- Photon ( +1/0/0)
- Likes ( 0/0/+1)
Remote HTTP requests
Jetpack adds 0 new remote HTTP requests to home page loads.
What we've learned?
- Jetpack will add at least 0.5 Mb (and up to 2.5 Mb) of peak memory usage on home page of a WordPress site;
- There is an effect on execution times, too, but a bigger sample size is needed for reliable comparison;
- Only a handful of Jetpack modules load additional assets to WordPress home page;
- Jetpack adds no remote HTTP requests on WordPress home page;
- Measure other plugins;
- Run tests in module specific places (single post/admin screen/etc.);
- More data for execution time comparisons;
By Arūnas Liuiza