Wrapping Up

Let's wrap up this chapter.

We'll cover the following


In this chapter we:

  • Used several tools provided by Go to measure and analyze the performance of our programs.
  • Started by developing a tool that processes content from CSV files.
  • Used benchmarks to measure its speed. Then we used the profiler to look for bottlenecks.
  • Iteratively improved the tool by using the results of the profiler and tracer tools.
  • Developed a new version of the tool that processes files concurrently.

Finally, we used the same techniques to analyze this version and made improvements to run the code more efficiently across the available CPUs.

What will we learn next?

In the next chapter, we’ll design tools that execute external commands and capture their output. We’ll interact with system processes. We’ll use some of the concurrency techniques we’ve learned here to handle system signals and exit appropriately. We’ll also use contexts to time out of long-running external commands.

Get hands-on with 1200+ tech skills courses.