I have been told recently that the times when Drupal 8 was slow passed long ago, that increased number of abstractions in Drupal 8 doesn't affect its performance, and that Drupal 7 hook system worse than Drupal 8 events in terms of speed. When I don't believe, I measure and encourage others to do so. Alright, let's benchmark Drupal 8 and Drupal 7 one more time.
- Bare metal, Ubuntu, Nginx 1.10, PHP 7.1, MariaDB 10.1.
- ApacheBench (ab) tool (what could be simpler)
ab -n 1000 -c 100for all experiments
- Each experiment should be taken five times (the average value goes into reports) Examples of ab commands:
# Anonymous: ab -n 1000 -c 100 http://drupal7/user # Authenticated: ab -n 1000 -c 100 -C auth_cookie_key=auth_cookie_value http://drupal7/user/1
I use Chrome Dev Tools -> Application -> Cookies to get the auth_cookie_key=auth_cookie_value pair.
- Drupal 7.59 (installed from archive)
- Drupal 8.5.3 (installed through composer)
Configuration 1: Pure code performance
- Minimal profiles
- Disabled cache and asset aggregation
- Enabled Bartik theme for Drupal 8 (to match Drupal 7 default theme)
And here are the results...
rps - number of requests per second (the more, the better)
Configuration 2: "Real-life" conditions
- Standard profiles
- Enabled all built-in caches (expiration: 1 day)
- Enabled CSS/JS aggregation
- Generated 1000 Article nodes with tags and up to 10 comments per node (Devel Generate)
Thanks to @marcvangend for encouraging me to test this configuration.
Now let's look at the results...
Although Drupal 8 has demonstrated a performance boost for anonymous requests on Minimal profile without cache, all other experiments have shown that Drupal 8 is still significantly slower than Drupal 7, unfortunately. A couple of ideas on why you may not feel this difference:
- PHP 7 is much better in terms of performance. Many people started using it from Drupal 8 because at first Drupal 7 had some compatibility issues with PHP 7. Some Drupal 7 sites are still on PHP 5.
- Drupal 8's frontend is better optimized, for example some render-blocking scripts moved to the bottom of the page, so it may feel like the page loads faster.
I understand that the results of my tests may not align with marketing strategies of Drupal service providers and other affiliated people, so I don't expect you to share this post or thank me. But despite this, I know deep down you appreciate my efforts )