The Revolutionary Impact of Gander Automated Performance Testing

The Revolutionary Impact of Gander Automated Performance Testing

In web development, performance transcends metrics to become the cornerstone of user experience and operational efficiency. The Drupal community has embraced this ethos by introducing Gander, an automated performance testing framework developed by Tag1 Consulting.

Nathaniel Catchpole, the main architect of Gander, and Janez Urevc, Product Manager for Gander, both from Tag1 Consulting, share their insights on Gander – a project they spearheaded – shedding light on its inception, hurdles, and significant contributions.

 

The Genesis of Gander

A critical need within the Drupal community drove the inception of Gander. Nathaniel explains, 

"For 16 years, we've seen performance regressions in Drupal only identified after they've impacted production websites. This reactive approach was insufficient.

The turning point came when Tag1 collaborated with Google's Chrome Team, leveraging their expertise to enhance Drupal's performance, notably integrating lazy-loading support into the core. This further improved Drupal's already best-in-class Core Web Vitals passing rates. After completing their initial tasks, the team searched for ideas and opportunities to enhance performance significantly. They quickly recognized that automated performance testing could provide such an impact. Despite its complexity—a reason many organizations avoid it—the team understood that this approach could yield substantial long-term benefits. This realization led to the creation of Gander.

Gander's Integration and Capabilities

Built upon Drupal's robust PHPUnit tests infrastructure, Gander enables developers to create precise, repeatable test cases that avoid common pitfalls, such as benchmarking, instead of profiling or testing the wrong aspect of a change. Results remain consistent across various scenarios, allowing teams to efficiently pinpoint and resolve performance bottlenecks. Gander stands out by seamlessly integrating into Drupal's core development process.

One of the most challenging aspects of working on Drupal performance issues is obtaining reliable performance testing and profiling results. Typically, individuals conduct tests on their personal machines and upload the results to the issue queue on Drupal.org. However, common errors occur, such as using benchmarking tools like Apache Bench instead of profiling tools like XHProf or testing scenarios inaccurately, such as evaluating a warm cache for changes that only affect cache rebuilds or authenticated users.

image
Nathaniel Catchpole 

 "Because Gander is built on Drupal’s PHPUnit tests, it allows everyone writing Drupal code to easily build precise, reproducible test cases so that results are consistent each time while avoiding all the common mistakes."

      says Nathaniel.

In terms of features, Gander encompasses two broad aspects:

Firstly, it allows for the quantification of various elements, such as HTTP requests for images, CSS, JavaScript assets, database queries, and cache requests. These elements can then be asserted within the PHPUnit tests themselves. This functionality ensures that any changes in the code do not inadvertently increase these metrics unless specifically intended.

Secondly, Gander focuses on timing metrics, including Web Vitals like First Contentful Paint and Largest Contentful Paint, time to first byte (TTFB), and other relevant data such as database query strings. These metrics are sent to an OpenTelemetry stack, which, in the case of Drupal.org, utilizes Grafana, Grafana Tempo, and Prometheus. This data transmission is facilitated through a dedicated CI/CD pipeline schedule on Drupal.org’s GitLab instance, allowing for comparisons between Drupal core branches over time.

These features set Gander apart from existing tools, which are typically used either in local development environments or for Application Performance Monitoring in actual production sites. Additionally, Gander offers a DDEV add-on, simplifying the process for anyone to begin utilizing Gander within a local development setting, complete with an OpenTelemetry/Grafana stack.

Environmental and Cost-Saving Benefits

According to Nathaniel, the environmental and cost-saving benefits of adopting Gander for organizations using Drupal are significant. He emphasizes that Gander facilitates proactive performance testing, catching issues before they impact user experience or lead to downtime. Nathaniel underscores the research-backed connection between website performance and user satisfaction, highlighting Google's findings. He states,

"Google has proven, through a tremendous amount of research and case studies, that more performant websites result in increased user satisfaction, which in turn improves user engagement, resulting in more page views, increased time on site, higher revenue, and other positive business outcomes."

Furthermore, he stresses the environmental advantages of faster websites, citing reduced energy consumption and a smaller carbon footprint. Nathaniel points out that improved sustainability not only benefits the planet but also translates into cost savings, particularly for large enterprises and hosting services operating at scale. He reiterates the collective impact of speed enhancements on Drupal Core, highlighting the positive implications for over a million sites. Every little speed boost adds up, creating a big win for everyone involved, including the planet. 

Enhancing Drupal's Ecosystem

Nathaniel highlights how Gander significantly enhances the Drupal platform for developers and organizations alike. Gander serves as a pivotal tool in identifying and rectifying performance regressions early in the development cycle, preventing unnoticed issues from impacting the overall efficiency of Drupal-powered sites. This systematic and automated approach to monitoring performance is crucial for maintaining a faster and more reliable Drupal environment.

During the development of Gander, the discovery of previously unknown performance regressions led to considerable improvements, such as a faster login process and a 10% quicker execution of Drupal's core automated test suite. Nathaniel points out,

"Fixing just one of these issues resulted in significant developer time and processing power savings, effectively paying off the investment in Gander."

 This exemplifies the immediate impact Gander has on enhancing efficiency and optimizing resource utilization.

Additionally, Nathaniel emphasizes that Gander's benefits are not confined to core developers alone. Its open-source nature allows for widespread use, making it an essential addition for any organization using Drupal, especially those already implementing automated testing in their workflows. 

Gander aims to simplify performance improvement for all Drupal users by abstracting complexity, reducing maintenance burdens, and ensuring easy integration into both local environments and hosted setups. This democratization of performance optimization tools represents a step forward in making advanced technology accessible to a broader range of users, potentially transforming the future of website performance and user experience on Drupal-powered platforms.

The Road Ahead for Gander

Nathaniel outlines the primary goals and roadmap for the ongoing development and integration of Gander into the Drupal ecosystem, focusing on enhancing the platform's performance and usability. The immediate objectives include substantial improvements to database query and cache logging, integrating HTTP requests into the dashboard, and implementing Interaction to Next Paint (INP), a novel metric for Core Web Vitals, which are crucial for assessing and enhancing web performance.

Moreover, Nathaniel emphasizes the importance of improving documentation and providing clear instructions for setting up PHPUnit tests and the OpenTelemetry stack for individual sites or contributed projects. This step is essential for enabling more developers to utilize Gander effectively in their workflows.

Now that Gander is incorporated into Drupal Core, with comprehensive documentation available, Nathaniel highlights a strategic shift towards raising awareness and fostering adoption within the Drupal development community. He states, 

"Our primary goal is to raise awareness and gain adoption in the Drupal core development community.

The focus is also on engaging organizations utilizing Drupal, encouraging them to adopt Gander for performance testing their websites. This concerted effort aims to enhance the overall performance of Drupal-powered sites, benefiting the wider Drupal ecosystem.

Advice for Leveraging Gander

Nathaniel advises developers and organizations to embrace Gander proactively: 

"Start using Gander for performance monitoring immediately. It's easy to integrate with existing automated tests and can significantly improve your site's scalability and user experience."

Nathaniel provides valuable advice to organizations and developers aiming to leverage Gander to enhance the performance and scalability of their Drupal websites. He strongly encourages the immediate use of Gander for site performance monitoring, highlighting its ease of integration for those already employing automated testing frameworks. Nathaniel suggests that incorporating performance assertions into existing test suites is a straightforward process, which can be done without needing an immediate commitment to deploying an OpenTelemetry/Grafana stack.

As users become more accustomed to Gander, Nathaniel recommends advancing to using the OpenTelemetry stack coupled with Grafana or similar tools. This progression allows for a more detailed visualization and website performance monitoring over time, leading to more informed decision-making and optimization strategies.

For those looking to begin their journey with Gander, Nathaniel advises consulting the Gander documentation and exploring the DDEV add-on. He emphasizes, "We strongly recommend starting to use Gander for site performance monitoring right away," underlining the importance of proactive engagement with the tool to drive performance improvements and scalability for Drupal websites.

Gander's Impact on Development and Performance Monitoring

Nathaniel elucidates two significant ways Gander aids developers in enhancing their Drupal website's performance. Firstly, by incorporating performance assertions into their automated tests, developers can ensure that any performance regressions inadvertently introduced during development trigger failures in their test suites. This proactive approach prevents such regressions from merging into the codebase, safeguarding the site's performance from deteriorating unnoticed.

Secondly, Nathaniel points out the advantages of utilizing an OpenTelemetry/Grafana-based dashboard for continuous performance monitoring. This tool allows developers to observe and analyze their website's performance over time, enabling them to identify any regressions or trends toward worsening performance that might not have been caught initially. He emphasizes the cumulative impact of minor issues, stating, 

"Lots of small performance problems can add up to a big performance problem that would otherwise be very difficult to diagnose and address."

This insight underlines the critical role of comprehensive monitoring in maintaining and improving website performance.
 

For those of you who are attending DrupalCon Portland and want to learn more about Gander a session titled "Revolutionizing Drupal with Automated Performance Testing: Deep Dive into Gander, the New Framework" will be conducted by Janez Urevc.
Also, they are part of the initiative keynote. So grab your tickets at a discounted rate for DrupalCon Portland before the regular registration opens on March 19th, 2024.

Differentiating Gander from Other Testing Tools

Nathaniel clarifies the distinctions between Andre Angelantoni's Automated Testing Kit (ATK) module and Gander Automated Performance Testing, highlighting their unique functionalities within the Drupal ecosystem. According to Nathaniel, there is no overlap between the two tools; ATK is designed to assist in functional testing and leverages frameworks such as Cypress.io and Playwright. In contrast, Gander specializes in performance testing and employs PHPUnit for its operations. He states,

"ATK provides test helpers for functional testing with Cypress.io and Playwright, while Gander is a performance-testing tool that uses PHPUnit.

This differentiation emphasizes that while both tools aim to enhance the quality and reliability of Drupal websites, they serve distinct purposes: ATK focuses on functional aspects, and Gander concentrates on performance metrics.

Gander was featured in the Tag1 Team Talks.


Credits: I sincerely thank Janez Urevc for helping me learn about Gander. Without his guidance, this article would not have been possible. Janez Urevc is the product manager for Gander, the performance testing framework for Drupal—Author.

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please let us know in the comments below and we will try to address the issue as best we can.

Related Organizations

Related Events

Advertisement Here

Upcoming Events

Latest Opportunities

Advertisement Here