Go programming language
Go is a relatively new open source programming language created by Google. Considering its recent growth, many developers and organizations have naturally become interested in it. With its main features, such as compiled-language performance, powerful and simple concurrency model and cross-compilation support, it can be considered as a true cloud language. A lot of critical infrastructure software, e.g. Docker and Kubernetes, is actually written in Go. Go Wiki has an impressive list of companies using Go https://github.com/golang/go/wiki/GoUsers.
Go’s built-in performance toolset: pprof
Along with its outstanding features, Go comes with a built-in performance profiling toolset called pprof. Pprof includes sampling profilers for CPU usage, memory allocations and blocking operations. A goroutine (a lightweight thread of execution in Go) tracing feature even allows developers to trace the execution in order to detect blocking operations in I/O, lock contention, system calls, etc. Pprof can be easily initiated from the Go command line tool for interactive performance analysis.
The effect of built-in performance tools on language adoption
It is an important strategic decision to implement performance profiling and troubleshooting instruments into a language, especially if it has been thought of as a server-side language.
While performance might not be a critical component for early adopters of a language, e.g. independent developers, startups or SMBs, it becomes important when the language is used in large deployments. For example, optimizing an application to run on fewer servers might not be worth it if the total number of servers/containers is less than 50-100. But if 2,000 servers can be reduced to 1,000 or fewer, that may have a significant impact on the bottom line.
Additionally, the cost of downtime and bad performance is now extremely high. Besides having a negative impact on customers, slow page loading times may even impact search engine ranking.
In the case of Go, some of the large deployments are also at Google. As a result, the language directly benefits from this as well. Performance optimizations are done not only at the application level, but to the language itself. This is reflected in multiple performance-related issues at Golang’s GitHub repository opened by developers based on information from built-in profilers.
Production use of pprof
The pprof toolset is rather low level for immediate business production use. It requires a command line tool connecting to it over the network. This assumes pprof has a listening port in the application, which should be secured from the outside world. Moreover, it might be tricky to locate a host in a container environment for profiling in the first place.
StackImpact solves these problems by introducing continuous, automatic production profiling services. Learn more about StackImpact: