Prelude This is the second post in a three part series that will provide an understanding of the mechanics and semantics behind the garbage collector in Go. This post focuses on how to generate GC traces and interpret them.
Index of the three part series:
Garbage Collection In Go : Part I - Semantics Garbage Collection In Go : Part II - GC Traces Garbage Collection In Go : Part III - GC Pacing Introduction In the first post, I took the time to describe the behavior of the garbage collector and show the latencies that the collector inflicts on your running application.
Continue readingApril 18, 2019
Jacob Walker
Go Instructor
One of the traps of concurrency is “incomplete work” which occurs when a program terminates before outstanding Goroutines complete. Depending on the program, this may be a serious problem. This post demonstrates the trap and discusses possible solutions.
Continue reading Integration tests give insights to the end-to-end operation of web services. In part 1 of this 2 part series over integration testing in Go we explore how to run integration tests in restrictive environments, such as Jenkins.
Continue readingDecember 19, 2018
Jacob Walker
Go Instructor
Goroutine Leaks are a common cause of memory leaks in Go programs. In my previous post, I presented an introduction to Goroutine leaks and provided one example of a common mistake that many Go developers make. Continuing that work, this post presents another scenario on how Goroutines could be leaked.
Continue reading November 12, 2018
Jacob Walker
Go Instructor
Goroutine leaks are a common source of memory leaks in concurrent programs. This post defines Goroutine leaks and provides one example of a leak that is easy to miss in production code.
Continue reading August 14, 2018
Erick Zelaya
Creative Director
In the months leading up to GopherCon, my wife Jamilet and I had come up with the idea of creating a “small” browser-based game for the convention using the racing theme. Neither of us had ever worked on a game before and we had no idea what was involved. However, we knew we wanted to design and build something special for the awesome Gopher community.
The original idea was to create a game where Gophers raced each other around a track.
Continue reading Introduction I teach a class called Ultimate Go. The class is three days long and teaches you the history, mechanics and semantics of the Go programming language. The idea is to teach you how to read code to the level that you can understand the behavior and impact your program is having on the machine. This helps you make better and more consistent engineering decisions.
At the same time, the class is very focused on teaching you how to optimize for correctness so the code you are writing is readable as a first priority.
Continue readingIntroduction One day I was talking to Damian Gryski in Slack about some performance improvements he made to his go-metro package. When I first looked at the changes I was completely confused how this could have any effect on the performance of the code. I felt the code was more readable, but more performant? I didn’t see it.
Then Damian started to talk to me about a compiler optimization called Bounds Check Elimination or BCE.
Continue readingIntroduction I’ve been seeing a lot of question about interfaces lately on Slack. Most of the time the answers are technical and focus on implementation details. Implementation is important to help with debugging, but implementation doesn’t help with design. When it comes to designing code with interfaces, behavior has to be the main focus.
In this post, I hope to provide a different way to think about interfaces and how to design code with them.
Continue readingIntroduction I was guided for many years to write functions that are generalized and to create layers upon layers of abstraction so things don’t break as business requirements change. That the cost of breaking a function signature, for example, is expensive and something that should be avoided. Therefore, write functions that take more generic parameters or hide things in a receiver or context to be less prone to breakage.
On the surface this seems like a good and reasonable idea.
Continue reading