Let’s assume this is a site that has dynamic content pertaining to the user, or content that changes very often, so varnish is out. Let’s also assume that there are no plugins and the theme is vanilla.
Can WordPress be tuned so it uses less memory each request? It seems to include all libraries and functions by default. Is it all or nothing, or can it load say the media functions only if it really needs them without being lobotomized?
I was going to ask this on StackOverflow, but I’m pretty sure they would have pointed me here. Maybe ServerFault?
The short answer is… not by much.
WordPress relies on, as scribu (a guy who started by writing very clever and useful plugins, such as Posts 2 Posts, WP CLI, Plugin Dependencies and many many others, ending up in the WP core team for a while) put it:
crappy language (PHP, an ancient version to boot) and crappy architecture (WP_Query).
Apart from this, you’re not the first to ask this question.
Having said that, one might ask: why use it than? Well, WP does have a few advantages:
- It’s popular (so you’ll always find people who know what needs to be done for getting you where you want to go),
- it’s intuitive,
- it’s modular, hence flexible,
- it has most of what a website or CMS might need (so you don’t need to code everything),
- it is a lot better than it used to be,
- it’s going to be even better,
- it is here to stay, at least for the foreseeable future…
…[the list goes on endlessly, with ever less important advantages WP has over its competition]