Why is CI so Damn Slow?

Rate this content
Bookmark
The video discusses the reasons behind slow CI performance and its impact on productivity and finances. Slow CI leads to increased compute time and higher costs. It emphasizes the importance of using faster, native tools like Rust and Go for CI jobs instead of JavaScript, which has a heavy runtime and dependencies. Dependencies like NPM or YARN can significantly slow down CI processes. The video advocates for native programs for static jobs and lightweight environments for dynamic jobs. Rome Tools aims to improve CI speed by using efficient languages and optimizing the parsing process. The video also addresses the performance issues with tools like Prettier and ESLint and how Rome's formatter and linter offer faster alternatives. It highlights the benefits of fast tools for developers, including those on slower hardware and internet connections. Lastly, it touches on the potential of machine learning for parser error recovery and the importance of cleaner code in both tools and normal code.

From Author:

We've all asked ourselves this while waiting an eternity for our CI job to finish. Slow CI not only wrecks developer productivity breaking our focus, it costs money in cloud computing fees, and wastes enormous amounts of electricity. Let’s take a dive into why this is the case and how we can solve it with better, faster tools.

This talk has been presented at DevOps.js Conf 2022, check out the latest edition of this JavaScript Conference.

FAQ

Slow CI performance is primarily caused by the tools used in the jobs, both in terms of their installation time and runtime. Tools written in languages like JavaScript, which require significant runtime support and dependencies, contribute to this slowness.

Improving CI performance involves using faster, native tools that don't require extensive runtime environments. For instance, using Rust instead of JavaScript for developing tools can significantly enhance execution speed and reduce dependency management overhead.

Task switching during CI delays can lead to decreased productivity and efficiency. Developers lose their working context when switching between tasks, leading to less task completion and potential delays in project timelines.

Rome Tools focuses on creating fast, native JavaScript tools by using languages like Rust, which offer high performance and efficient memory usage. This approach allows for the development of static binaries that eliminate the need for installing dependencies during CI processes.

Integrating a fast formatter like the one from Rome Tools can drastically reduce the time taken to format large files, from seconds to milliseconds, thus fitting seamlessly into a developer's workflow and enhancing productivity.

Considering tool performance is crucial because it can significantly affect development speed, costs, and the overall efficiency of the development process. Faster tools lead to quicker iterations and less waiting time, directly impacting developer productivity and project timelines.

Slow CI can lead to increased compute time, which directly translates into higher costs. For example, organizations like GitLab have experienced ballooning expenses due to the extensive use of CI during periods of growth.

Nicholas Yang
Nicholas Yang
27 min
24 Mar, 2022

Comments

Sign in or register to post your comment.

Video Transcription

Available in Español: ¿Por qué es tan lento el CI?

1. The Impact of Slow CI on Developer Productivity

Short description:

Hi everybody. My name is Nicholas. I'd like to talk to you about why your CI is so damn swell. Waiting for CI has a direct dire effect on productivity and finances. When encountering a time sync like a slow CI, slacking off or starting another task are not effective solutions. Task switching in software development projects leads to less task completion and disrupts flow. Slow CI interrupts the workflow and decreases efficacy and efficiency. Forgetting about a CI job can cause significant delays in merging PRs.

Hi everybody. My name is Nicholas. I'm a software developer at Rome Tools, and I'd like to talk to you all about why your CI is so damn swell.

We've all been there. You've pushed your latest code to GitHub, your CI service is spitting up, and it's taking forever. You wait and wait and wait, only to get your result back 5, 10, even 20 minutes later. It's annoying, it's disruptive, it's a waste of your damn time. Normally, we just accept this as an eternal truth. CI is swell. I don't think that's okay.

Having to wait for CI has a direct dire effect, both on your productivity and on your finances. Let's start with a resource that matters to all of us. Developer time. I don't know about you all, but when I encounter a time sync such as a slow CI, I do one of two things. I slack off, or I start another task. Slacking off is clearly a net negative. Sure, we all deserve breaks, but not every single time we push up some code. Our CI shouldn't determine when we work or not. But Nick, you could just start another task. And yeah, starting another task seems tempting. We're all capable multitaskers. Turns out no, we are not.

In the paper, Task Interruption in Software Development Projects, the authors measured the effect of task switching on productivity. It wasn't good. In particular, they noted that self-interruptions, basically when you purposely switch between tasks, they tend to be more disruptive than external interruptions and lead to less task completion. With slow CI, this flow gets constantly interrupted. You end up switching between the CI jobs and your new task, losing your working context and therefore your efficacy and efficiency. Or worse, you get focused on your new task, forget about your CI job, and only remember a few hours later that your job is done. You ping your reviewer just to realize that they've gone home. Suddenly, a quick PR takes two days or more to merge.

2. Debugging CI Workflows and Tool Slowness

Short description:

Even worse is when you have to debug a CI workflow. A 15-minute development cycle is not acceptable. Slow CI means more compute time, which means more money. Let's figure out why CI is slow. There are two types of CI jobs, static and dynamic jobs. If your CI job is slow, it's likely because your tools are slow. These tools are also slow in their installation time. Dependencies are a necessary part of modern software development.

Even worse is when you have to debug a CI workflow. Whenever I have to debug one, it's so awful. I end up tweaking a setting, waiting for the job to complete, getting distracted, and only seeing the results 15 minutes later. A 15-minute development cycle is not acceptable in this day and age. But it's not just developer time. Slow CI means more compute time, which, as anyone who stared in shock at their AWS bill knows, means more money.

One such example is the free desktop GitLab instance, which hosts a bunch of free software projects, such as Mesa, the Linux kernel drivers, and many others. They experienced a massive period of growth in the late 2019 to early 2020 era. However, their expenses ballooned accordingly, first at $75,000 in 2019. And then they were projected to hit $90,000 in 2020. They managed to cut costs before they ran out of money, but still, for an open source project, that's a massive amount to be spending on CI. Let's do better. Let's figure out why CI is slow.

To do so, we should look at what a CI job does. At its core, there are two types of CI jobs, static and dynamic jobs. Static jobs apply developer tools, such as a Linter, Bundler, Formatter, etc. to your code without executing the code. Dynamic jobs may also apply tools, but they have to run your code. We're going to focus on static jobs, but many of these lessons apply to dynamic ones too. Regardless, if your CI job is slow, it's likely because your tools are slow. But what do I mean exactly by slow? Of course, I mean the tools are slow in their runtime. However, for CI, there's a second type of slowness. These tools are also slow in their installation time. Let's take ESLint. It's a great tool. However, like many tools in the JavaScript ecosystem, it has a lot of dependencies. This isn't a dependency shaming talk. I use dependencies. You use dependencies. They're a necessary part of modern software development.

QnA