Wrapping Up

Powerful Command-Line Applications in Go — by Ricardo Gerardi (58 / 127)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Exercises | TOC | Chapter 6 Controlling Processes 👉

In this chapter, you used several tools provided by Go to measure and analyze the performance of your programs. You started by developing a tool that processes content from CSV files. You used benchmarks to measure its speed. Then you used the profiler to look for bottlenecks. You iteratively improved the tool by using the results of the profiler and tracer tools. You developed a new version of the tool that processes files concurrently. Finally, you used the same techniques to analyze this version and made improvements to run the code more efficiently across the available CPUs.

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

Footnotes

[25] https://golang.org/src/math/all_test.go

[26] https://golang.org/pkg/reflect/

[27] https://golang.org/pkg/testing/#hdr-Benchmarks

[28] https://www.graphviz.org

[29] https://www.graphviz.org/download/

[30] https://golang.org/doc/faq#closures_and_goroutines

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.