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]