---
title: "Profiling Performance Bottlenecks in Production"
description: "A slow Sidekiq background job at Doximity was traced with the Vernier sampling profiler to a Redis fetch memoized on a per-record builder instance."
url: "https://swe.quest/articles/profiling-performance-bottlenecks-in-production-057c5006f3673d4b"
canonical: "https://technology.doximity.com/articles/profiling-performance-bottlenecks-in-production"
source: "Doximity Technology"
published: "2026-06-18"
difficulty: "medium"
kind: "Case study"
reading_minutes: 8
tags: ["ruby","performance","debugging","observability"]
---

# Profiling Performance Bottlenecks in Production

A post on [Doximity Technology](https://swe.quest/sources/doximity.md), published 2026-06-18, 8 min read, Case study. Original: [https://technology.doximity.com/articles/profiling-performance-bottlenecks-in-production](https://technology.doximity.com/articles/profiling-performance-bottlenecks-in-production)

## Summary

A slow Sidekiq background job at Doximity was traced with the Vernier sampling profiler to a Redis fetch memoized on a per-record builder instance. Because a new builder was created for each record, the full reference dataset was refetched tens of thousands of times. Moving the fetch to the parent batch class and passing it down cut that step from 8.95s to 1.44s on ~45k records, and overall job runtime fell by about 80%. The practical lessons are to use dashboards and traces to pick the target, then profile it, and when profiling in production, benchmark separately, plan cleanup of side effects, and use Sidekiq's built-in Vernier integration.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Ruby](https://swe.quest/tags/ruby.md) (Languages)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Debugging](https://swe.quest/tags/debugging.md) (Engineering practices)
- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)

## Prerequisites

- Ruby basics ([easy posts on Ruby](https://swe.quest/tags/ruby.md?difficulty=easy))
- Sidekiq background jobs
- memoization

## Keywords

Vernier, Sidekiq, Firefox Profiler, Redis, Grafana, flame graphs

## Related posts

- [How we improved availability through iterative simplification](https://swe.quest/articles/how-we-improved-availability-through-iterative-simplification-1aa63e0def5687e6.md): GitHub Engineering · 2024-07-23 · Medium · 6 min read · Performance engineering, MySQL, Ruby, Observability, Deployment
  GitHub cut timeouts in its Rails monolith with small, measured changes found through Datadog metrics, Splunk logs and custom MySQL slow-query monitors.
- [GitHub Does My Operations Homework: A Ruby Speed Story](https://swe.quest/articles/github-does-my-operations-homework-a-ruby-speed-story-423c3866d401e486.md): Shopify Engineering · 2021-10-19 · Medium · 8 min read · CI/CD, Performance engineering, Ruby, Compilers
  Shopify's YJIT team runs a continuously updated public benchmark site, speed.yjit.org, that reports YJIT as 20.6% faster than interpreted CRuby and 17.4% faster than MJIT overall, and 18.5% faster than CRuby on Railsbench.
- [How we built a Ruby library that saves 50% in testing time](https://swe.quest/articles/how-we-built-a-ruby-library-that-saves-50-in-testing-time-128208a842ec0eb3.md): Datadog Engineering · 2024-11-01 · Hard · 12 min read · Ruby, Testing, Performance engineering, Runtimes & VMs, CI/CD
  Datadog built a Ruby test impact analysis library for its Intelligent Test Runner that maps each test to the source files it executes, so tests unrelated to a commit's changed files can be skipped, cutting testing time roughly in half.
- [Diggin’ and Fetchin’ with TruffleRuby](https://swe.quest/articles/diggin-and-fetchin-with-truffleruby-52a4362b84ef4768.md): Shopify Engineering · 2021-08-20 · Medium · 13 min read · Ruby, Runtimes & VMs, Performance engineering, Compilers
  Refactoring a chained Hash#fetch with default values leads to prototyping a new Hash#dig\_fetch method in TruffleRuby, combining fetch's KeyError/default semantics with dig's nested traversal.
- [Making Shopify’s Flagship App 20% Faster in 6 Weeks Using a Novel Caching Solution](https://swe.quest/articles/making-shopify-s-flagship-app-20-faster-in-6-weeks-using-a-novel-caching-100f1c4cb3fa31e6.md): Shopify Engineering · 2021-09-22 · Medium · 8 min read · Caching, Ruby, Scaling, Deployment, Performance engineering
  Shop's home feed, which aggregated orders and carrier tracking data and accounted for 30% of database load, was moved behind a custom write-through cache in Memcached, cutting database load by 15%, overall GraphQL latency by about 20% and CPU usage by a double-digit percentage.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
