Apart from improvements in codes, one could also tweak web servers and caching packages. I have used two different stacks, LAMP and another one. While LAMP is easy to setup but it is not really that fast. The other stack I have using and currently using is Apache, nginx, Memcached, Varnish and PHP-FPM, which is the stack support by Cloudways platform (https://www.cloudways.com/en/drupal-cloud-hosting.php ) that I am using to host my website. This stack is optimized to focus on speed through caching and quick processing of PHP codes with FastCGI. I would recommend you try this stack or this platform and run benchmarks of your Drupal website to see how much it will improve the performance.
Apart from improvements in codes, one could also tweak web servers and caching packages. I have used two different stacks, LAMP and another one. While LAMP is easy to setup but it is not really that fast. The other stack I have using and currently using is Apache, nginx, Memcached, Varnish and PHP-FPM, which is the stack support by Cloudways platform (https://www.cloudways.com/en/drupal-cloud-hosting.php ) that I am using to host my website. This stack is optimized to focus on speed through caching and quick processing of PHP codes with FastCGI. I would recommend you try this stack or this platform and run benchmarks of your Drupal website to see how much it will improve the performance.