Concurrency in Go in the form of goroutines is a very convenient means for writing modern concurrent software, but how does your Go program run these goroutines efficiently?
In this post, we will peek under the hood to help you understand how the Go runtime scheduler implements this magic by looking into it from the design perspective and how to use it to interpret scheduler trace information from a Go program during performance debugging.

All of the engineering marvels have come out of need, So to understand why there is a need to have a go runtime scheduler and how it works lets time-travel back to the history of the operating system which will give us insight into problems, as without understanding the root of a problem, there is no hope of solving it. …

Image for post
Image for post

Go has a built-in testing framework provided by the testing package, that makes writing tests easier, but how do we write a more complicated test that requires mocking?

In this post, we will learn how to take advantage of structs and interfaces in Go to mock any service or library you might be using, without using any 3rd party tools and libraries.

We will start by defining our system to understand what we are going to test and mock.

Image for post
Image for post
Example System and Integration.

Our system has two components.

  1. “Our Service” that we own and build.
  2. “Third-party service or library” that interacts with some database and we use the functionality of it in our service. …

With examples in Go (Golang).

Whether you’re just getting started with programming, or you have years of experience, you’ve likely at some point of the time will do or have done some performance test of your application to measure the Latency (Latency is defined as the time it took one operation to happen).

When it comes to latency result analysis, It’s tempting to reach for basic statistics like mean, median or max. But this ignores relevance problems — turning the focus away from latency behavior distribution over time toward others, which often hide the truth.

Image for post
Image for post
Actual Vs Mean(Avg), Median, Max report.

The objective of this blog post is to explain the importance of the analysis of 99 percentile, their notations, differences with basic statistics like mean, median or max, and by the end turn this newly learned knowledge into a real-world scenario and write an Application in Go(Golang) around this. …


Ankur Anand

Learning to Learn in Feynman Technique. -https://ankuranand.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store