The Drupal community has continuously sought ways to enhance the performance and efficiency of Drupal sites. The performance testing framework Gander has been part of Drupal core since version 10.2. The result of joint efforts between the Google Chrome team and Tag1 Consulting, this powerful tool is specifically designed to optimize Drupal performance. Optimized performance ensures that sites are not only fast but also efficient and sustainable.
Today, we will take a closer look at how Gander played a crucial role in improving the Drupal core test suite runtime by 10%.
Identifying A Core Performance Issue
Gander's impact on Drupal development was recently highlighted by its identification of a performance issue within Drupal core. The issue (#3410312) reported a particular code section being called redundantly during automated test runs and on live websites, resulting in delays.
The Bottleneck Identified
Drupal is designed to use the flood system for user logins. It first checks if a flood protection table exists in the database. If it does not exist, Drupal postpones the creation of the table until it needs to write to it instead of creating the missing table immediately.
What can happen is that the flood table is not created on new sites until an end user inputs their password wrong, forcing a write operation in the database. For every successful login before the flood table is created, queries stack up and this can result in slowing for some Drupal instances.
Thanks to Gander, this bottleneck was quickly identified.
Simple Fix, Big Rewards
This led to a simple yet significant resolution – create the flood database table immediately if it does not exist – and test runs became approximately 10% faster.
Test suite will install a clean environment for every test (effectively a fresh Drupal install) and also log into it for many tests. Tests also generally never input an incorrect password, which means that we were performing these redundant checks over and over. Due to the number of the tests in the Drupal core test suite these checks add up.
This improvement is more than just a nice statistic. For developers and site owners, it means significantly less waiting for test results, allowing them to iterate and deploy faster. Performance optimization through tools like Gander also has the broader impact of enhancing individual and team productivity.
For those interested in the technical details, the specific issue can be explored further on Drupal.org (#3410312).
Join the Effort
How Gander identified this real-world Drupal performance bottleneck is just one example of how collaborative efforts can lead to significant improvements in Drupal's ecosystem. It highlights the importance of community engagement in identifying and solving problems, making Drupal faster and more efficient.
We invite all members of the Drupal community—developers, testers, users—to join this ongoing effort. You can start using Gander today to optimize your own Drupal sites, contribute to its development and improvement, or participate in the broader conversation on Drupal.org.
See You At DrupalCon Portland!
Join us at DrupalCon Portland where we are hosting a deep dive into Gander. We will explain the motivation for and basics of Gander, have a live demo, and show how to use it for Drupal Core development and on your own site. We will also talk about the benefits, how we got here, where we go from here, and ask for your feedback.
Don’t miss out! Join us on Tuesday, May 7, 2024, at 16:10 PDT in Room B117-119.
We will also present Gander as part of the Drupal Project Initiatives Keynote on Wednesday, May 8, 2024, at 09:00 PDT in Room 201-203 or Ballroom.
Together, we can continue to push the boundaries of what's possible, ensuring that Drupal performance is continually tested and improved.
Optimize your Drupal site performance with Gander
Photo by Gary Bendig on Unsplash