Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The Whop & Chop: Cutting CI time in half
Search
Irina Nazarova
August 27, 2025
Programming
0
1.1k
The Whop & Chop: Cutting CI time in half
Irina Nazarova
August 27, 2025
Tweet
Share
More Decks by Irina Nazarova
See All by Irina Nazarova
Using Vite Ruby, Vite Conf 2024
irinanazarova
0
22
Learning to consult. Learning to live. Irina Nazarova @ Friendly.rb 2025
irinanazarova
0
140
Startups on Rails in Past, Present and Future–Irina Nazarova, RailsConf 2025
irinanazarova
0
730
Programmable colors: bridging design and code @ Figma Confir 2025
irinanazarova
1
300
Startups On Rails 2025 – Sin City Ruby
irinanazarova
2
130
Startups On Rails 2025 @ Tropical on Rails
irinanazarova
0
1.5k
Evolution of realtime and AnyCable Pro – Rocky Mountain Ruby, 2024 Irina Nazarova
irinanazarova
1
220
Rails World 2024 Lightning Talk Irina Nazarova "How to run a Ruby meetup"
irinanazarova
1
100
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Other Decks in Programming
See All in Programming
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
150
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.5k
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
6
690
CSC307 Lecture 04
javiergs
PRO
0
660
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
440
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
230
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
330
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
Claude Codeと2つの巻き戻し戦略 / Two Rewind Strategies with Claude Code
fruitriin
0
150
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
120
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
0
4.3k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
120
Everyday Curiosity
cassininazir
0
130
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Music & Morning Musume
bryan
47
7.1k
BBQ
matthewcrist
89
10k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
380
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
240
Transcript
The Whop & Chop Cutting CI Time in half Irina
Nazarova
Thank you!
3 400000000 800000000 1200000000 1600000000 April 2021 April 2022 April
2023 April 2024 April 2025 1.48B 1.08B Total transaction volume, $ 0.74B 0.52B fast-paced startup built on Rails and Next.js
None
None
The stack 6 Problem: Slow test suite Rspec thoughtbot/ factory_bot
7 github.com/test-prof/test-prof
8 Rspec Minitest TestProf: toolbox to profile slow tests -StackProf
Integration -FactoryProf -TagProf -EventProf github.com/ tmm1/ stackprof
9 Rspec Minitest TestProf: helpers to speed up slow tests
-let_it_be: create test data once for an entire context -factory_default: avoid rebuilding associated objects by reusing a cached instance -before_all: runs setup only once per group
Let’s get to profiling! Find the report in tmp/test-prof/ Review
fl amegraph with Speedscope.app Focus: top method time spent 10
StackProf report 11
Top time-consuming methods -Heavy database activity (Trilogy#query), suggesting lots of
factories or queries. -Calls to external services like Stripe and OpenAI that should be mocked. -Signi fi cant amount of time spent in logging. 12
Let’s switch off logging in test! 13
A custom Sentry logger detected! 14 Let’s go a bit
further
Easy! How much time did we save? 15 Before: Single
process: ~25 min CI (16 workers): ~4 min After: Single process: ~12 min CI: ~2 min 50% CI time saved!
Next suspect: FactoryBot TagProf to watch for AR, factory creations
and Sidekiq jobs factory.create events were now responsible for more than half of the total test execution time 16
Factory Optimization Strategy 1: let_it_be — Create Once, Use Many
Replace let with let_it_be to create the record once for the entire describe block. Don’t use it on objects whose state is modi fi ed by one test. 17
Strategy 2: create_default — create resuable associations 18 Let’s fi
rst pro fi le factories: compare total vs. top-level factories to spot an issue in associations Factory Optimization
Strategy 2: create_default — create resuable associations 19 Factory Optimization
What’s next? 20
Parallelization Swap parallel_tests for test-queue Problem: it splits tests by
fi les. 21 parallel_tests test-queue Solution: split by individual tests.
Sound good? Well… Over 100 tests failed. The errors were
bizarre and seemingly random, with no obvious connection to our changes. 22
The Flaky Test Hunt: A Guide to Isolation Our new
test-queue setup had exposed years of hidden state leakage. 23
How we fought this… 24
Soon on evilmartians.com /chronicles 25
Shoutouts Julia Egorova Igor Platonov Travis Turner Vladimir Dementyev Reach
out:
[email protected]