# From slow tests to slow production: Debugging with Stackprof

DevFeed: [From slow tests to slow production: Debugging with Stackprof](<https://devfeed.tech/articles/from-slow-tests-to-slow-production-debugging-with-stackprof-33519.md>)

Original publisher: [Read original article](<https://www.aha.io/engineering/articles/debugging-with-stack-prof>)

Published: 2026-08-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Aha! Engineering Blog](<https://devfeed.tech/sources/aha-engineering-blog.md>)

Topics: [debugging](<https://devfeed.tech/topics/debugging.md>), [Tooling](<https://devfeed.tech/topics/tooling.md>), [RSpec](<https://devfeed.tech/topics/rspec.md>), [Databases](<https://devfeed.tech/topics/databases.md>)

Tags: [ci](<https://devfeed.tech/tags/ci.md>), [cpu-time](<https://devfeed.tech/tags/cpu-time.md>), [database](<https://devfeed.tech/tags/database.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [logs](<https://devfeed.tech/tags/logs.md>), [overhead](<https://devfeed.tech/tags/overhead.md>), [performance](<https://devfeed.tech/tags/performance.md>), [production-debugging](<https://devfeed.tech/tags/production-debugging.md>), [profiling](<https://devfeed.tech/tags/profiling.md>), [rspec](<https://devfeed.tech/tags/rspec.md>), [snapshots](<https://devfeed.tech/tags/snapshots.md>), [tests](<https://devfeed.tech/tags/tests.md>), [timing](<https://devfeed.tech/tags/timing.md>)

## AI overview

An investigation into tests that became six times slower traces the stall to code generating example data and Active Record callbacks. The article explains using Stackprof with RSpec to profile the test, including I/O time, and reports that the test spent 71% of its time sleeping.

## Source excerpt

One morning, a developer announced in our Slack channel that some tests were failing on our main branch. The cause of the failures was not obvious. No recent PRs seemed related, and neither the code nor the tests had changed in a long time. The test