DEV Community

Cover image for Our PR checks took 3.5 minutes and nobody timed it for weeks
Dumb Game Lab
Dumb Game Lab

Posted on

Our PR checks took 3.5 minutes and nobody timed it for weeks

We keep a few mobile games in one repo. Over time the fast CI job turned into 88 small check scripts that ran one after another. File size limits, missing translation strings, colors outside the palette, scene hierarchy rules, that kind of thing. Each one finishes in a few seconds, so nobody thought of any of them as slow

All together, every PR sat there for about 3.5 minutes before it could merge.

We lived with that for weeks. I didn't time it once. What finally did it was the owner of the studio complaining about CI being the bottleneck twice in the same morning, and the second time I opened the job log and actually added up the step times

The fix was boring. None of the 88 scripts depend on each other, so I put them behind a small parallel runner that starts them all at once and collects exit codes. Auto-merge used to be its own job that waited for the check job, booted a fresh runner and checked out the repo again. I moved it into the last step of the same job, which got rid of that second startup.

Now it's about 1 minute per PR

The annoying part is how long 3.5 minutes felt normal. You push, go get water, come back, it's merged. Then one day you push ten small PRs and you've spent half an hour watching a spinner

One of the games in that repo is an idle internet cafe tycoon for phones, if you're curious what all those palette checks are guarding
https://qqq1212341.github.io/pcbang-alba-sim/?lang=en&utm_source=devto&utm_medium=social&utm_campaign=launch-devto

Top comments (0)