Mastering Code Search with JetBrains Scope

Background As software engineers, one of the most crucial skills we develop is the ability to search through code efficiently. Whether it’s finding a specific function, understanding how a certain feature is implemented, or tracing a bug, being able to quickly navigate a codebase is essential for productivity. However, many codebases can be complex and sprawling, leading to noisy search results that hinder rather than aid our progress. JetBrains provides a few tools to help you refine your code search and focus on what’s important....

September 30, 2023 · 3 min · Johnny Metz

Supercharge Your Django App: 7 Sneaky Tricks to Crush Slow Database Queries

Optimizing Django query performance is critical for building performant web applications. Django provides many tools and methods for optimizing database queries in its Database access optimization documentation. In this blog post, we will explore a collection of additional and essential tips I’ve compiled over the years to help you pinpoint and resolve your inefficient Django queries. Kill Long-Running Queries with a Statement Timeout PostgreSQL supports a statement_timeout parameter that allows you to set a maximum time limit per query....

August 13, 2023 · 6 min · Johnny Metz

Optimize Django Query Performance by combining Select Related and Prefetch Related

Introduction When building a Django application, one of the key challenges developers face is optimizing database query performance. Django provides two tools,select_related and prefetch_related, that reduce the number of database queries, and increase the performance of your application. This blog post explores the power of these two methods and how to combine them to maximize your application’s query performance. My team at PixieBrix implemented these techniques and have seen a significant improvement in query performance and customer satisfaction....

May 13, 2023 · 3 min · Johnny Metz

[Cross-Post] Django performance: Sort by a Custom Order

See the post here: Sort a Django Queryset by a Custom Order

January 2, 2023 · 1 min · Johnny Metz

Dockerize your Cypress tests

See the source code for a working example. UI testing is a critical part of any modern web application. My favorite testing framework is Cypress which enables you to write clean, fast and reliable tests. It consists of two main commands: cypress run: Runs Cypress tests from the CLI without a GUI. Used mostly in CI/CD. cypress open: Opens Cypress in an interactive GUI. Used for local development. I like to dockerize my entire application so it can be run anywhere (my machine, coworker’s machine, CI/CD, etc....

January 31, 2022 · 5 min · Johnny Metz