Interesting performance benchmarks with a new theme

Note – I’m doing a lot of performance testing on this production site so some things might be sketchy for the next couple of days.

I launched this new theme about ten days ago and have been running performance tests against it ever since. Making the home page much more static has yielded some remarkable performance boosts on its own. But over the weekend, I experimented with generating static menus into header.php and footer.php. The results of that were absolutely crazy so I pushed a new change into the theme last week and plan to have a fully static menu system by the end of 2019.

In very complex performance testing with Locust.io, with caching turned off, making my header and footer menus static increased my requests per second by over 30%. With aggressive caching turned on, making those menus static still increased my requests per second by over 4%.

The change was so noticeable that I pushed a new change into production. The footer menu is 100% static. My static generator plugin is still sketchy as hell so implementing the main menu into production sounds like a nightmare best reserved for Boxing Day. But the performance increase is already noteworthy.

It’s interesting how being really conservative with SQL queries can fundamentally change how a website performs. You don’t notice any performance differences until you’re under significant load. When my server is under significant load, going to a fully static menu system saves over 100 SQL queries per second. With Apache, that translates into significantly faster responses and significantly more requests per second.

All of this has me wondering if Nginx is a better solution for WordPress so when I get some time, I’m going to do these benchmarks again with Nginx instead of Apache. It’s entirely possible that all of my performance changes work because they work better with Apache. I’ll be sad and confused if switching to Nginx makes all of the development I’ve done over the last couple of months a complete waste of time!

That said, I’m glad that this experiment has been a success. I know more about WordPress internals than I knew in September and it’s been great watching my server run faster!

Note – I’m doing a lot of performance testing on this production site so some things might be sketchy for the next couple of days.

Leave a Reply

Your email address will not be published. Required fields are marked *