Nothing drains your energy faster than waiting on a slow script. That was my life until I discovered the power of multi-threading.
The Problem
I was tasked with deleting our old Cumulus pipelines.
A senior dev handed me a simple Bash script that went through a list and deleted each one.
Deleting a single pipeline wasn’t hard, but it took five minutes per pipeline. And there were 365 pipelines. You can do the math that’s over 30 hours of pure waiting.
My First Attempt
I thought, “There has to be a faster way.”
Since it was just a Bash script, I figured I could edit it. My first idea was to use tmux, spinning up multiple terminals on my EC2 instance. That would let me run several deletions in parallel.
But no luck I couldn’t install tmux on the server.
The Breakthrough
I turned to ChatGPT for advice. That’s when multi-threading was brought up.
Instead of waiting for one pipeline to finish before starting the next, I could run many deletions at the same time.
That one change meant I could delete as many pipelines at once. No babysitting, no endless waiting just blazing through the list.
The Result
What I thought would take a full week, I finished in under 5 hours.
I even had time left over to work on other tasks, doubling my productivity for the day.
When I shared the approach and wrote up documentation, our senior dev was impressed. What started as a painful, tedious job turned into a chance to show creativity and initiative.
The Lesson
Don’t accept “slow” as the default. If you think there’s a faster way, chase it down.
A little creativity and the right tool can turn a week long task into a single productive afternoon.
Top comments (0)