My Work on PerfCompare: Firefox's Performance Comparison Tool

My Work on PerfCompare: Firefox's Performance Comparison Tool

Introduction

When building software, it's important to know if your changes make things faster or slower. Imagine you're working on a website, and after adding a new feature, the page takes an extra second to load. That’s not great, right? Engineers face this challenge all the time, especially in large projects like Firefox.

That’s where PerfCompare, Mozilla’s performance comparison tool, comes in! it helps engineers measure how their changes affect performance, so they can catch and fix slowdowns (called "regressions") before they reach users.

I’m an Outreachy intern at Mozilla, working on adding a new search feature to PerfCompare.

What is PerfCompare?

PerfCompare allows engineers to compare the performance of revisions (also known as patches) against a base version of Firefox’s code. This ensures that every update either improves performance or at least doesn’t introduce slowdowns. It answers questions like:

  • Did this code change make Firefox faster or slower?

  • By how much?

  • How confident are we in these results?

The tool offers two comparison workflows:

  1. Compare with a Base: Engineers compare new changes to a single base revision.

  2. Compare Over Time: New revisions are tested against a base repository’s history over a specified period.

The results are presented in a table that includes:

  • Platform: The environment where tests ran (e.g., Windows, Mac, Linux).

  • Delta: The performance difference between the base and new values, shown as a percentage. A negative delta means improved performance, while a positive one indicates a regression.

  • Confidence: A statistical measure (based on the T-test) of how certain the results are. High confidence means engineers can trust the results more.

This helps engineers quickly identify whether a patch caused an improvement, regression, or no significant change.

Check out PerfCompare’s documentation! If you have any questions, join the discussion on our Matrix channel!

Why PerfCompare Matters

Firefox serves millions of users who expect a fast and reliable browsing experience. With PerfCompare, engineers can:

  • Detect regressions early, preventing issues from affecting users.

  • Validate improvements, ensuring every change contributes positively.

  • Analyze how changes perform across platforms and over time.

By catching potential problems early, PerfCompare saves time, reduces debugging efforts, and keeps Firefox running smoothly.

What’s My Role in This Project?

I’ll be working on a new search feature for PerfCompare.

This feature will make it easier for engineers to find specific information about performance tests, like:

  • Bug numbers (e.g., "What patch introduced this bug?")

  • Patch summaries (e.g., "What’s this patch about?")

  • Author names (e.g., "Who wrote this patch?")

In other words, the search feature will allow engineers to quickly dig into the details they care about, without having to scroll through tons of data.

How Are We Building This Search Feature?

Here’s an overview of our approach to creating this functionality:

  1. Understanding the Tool: First, I had to learn how the tool works and what kind of data it handles. For example, performance test results are stored in a database, and each result is tied to a specific patch.

  2. Choosing the Right Solution: After discussing with my mentors, we decided to use the database’s full-text search capability to power the search feature. This is efficient because:

    • It doesn’t require adding new columns or modifying the data structure.

    • It can search across multiple fields (like bug numbers, authors, and summaries) all at once.

    • It works for all existing data, not just new entries.

  3. Implementing the Feature: we are using a tool called SearchVector in Django (our backend framework) to set up the search functionality. It’s a bit like teaching the database to quickly find information across several fields.

Challenges and What I’m Learning

One of the biggest challenges so far has been understanding how all the pieces of PerfCompare fit together. The tool involves many moving parts, from the backend and database to the user interface. Thanks to my mentors’ guidance, I’ve been able to get a solid understanding of how most things work on the frontend side of the project.

Another challenge is that I’m new to Python and Django, which means learning a new programming language and framework while still trying to get a hang of everything. it’s incredibly exciting to step outside my comfort zone and tackle something new.

I consider myself highly adaptable and a quick learner, so I’ve embraced this challenge as an opportunity to grow. With the support of my mentors and Mozilla’s excellent documentation, I’m making steady progress and building confidence in my skills.

Ultimately, the work I’m doing helps make Firefox better for everyone. By giving engineers the tools they need to detect and fix performance issues early, we’re ensuring a faster, smoother experience for users around the world. For me, this project has been an amazing opportunity to contribute to open-source software, explore new technologies, and grow as a developer.

Join Mozilla’s Community

Mozilla’s mission is to make the web open, accessible, and fast for everyone. If you’re passionate about contributing to open-source projects, there are many ways to get involved. Whether you’re a beginner or an experienced developer, Mozilla has opportunities for you to grow your skills and make a difference. You can find more about getting started contributing at Mozilla at https://codetribute.mozilla.org/.