Week 40 - 2025
Hello World.
This is the beginning of my online journaling.
I intend to keep this as purely a journal of what I learnt over the week, but over time might add some personal stuff here. Wish me luck !!
I started the week setting up the VPS for this site. My original choice was Digital Ocean. The cheapest option there did not have the have the memory I required and the option with sufficient memory would burn a huge hole in my pocket.
Eventually I settled with Hostinger. The unique feature that I discovered was that it you can configure it to start the OS of your choice with a preloaded software. In my case, Docker. I did not have to install Docker and Docker compose plugin. That was 🔥🔥🔥.
Moving on. My mentor Siri pushed me to build demos for our weekly meeting at Web Deep Dive. So I set out to build something to compare HTTP/1.1 and HTTP/2. I’m elated that I was able to demonstrate practically what I had learnt. Here’s the Github repo.
Basically, with HTTP/1.1 the request are sent one after the other in a single connection. So the chrome browser would create up to 6 TCP connections per origin to speed the fetching process. But with HTTP/2 the requests are multiplexed in single connection, so the browser would create only one TCP connection. But the problem with HTTP/2 (also with HTTP/3 a.k.a QUIC) is that the server would experience a spike in requests since many requests are bundled up into one.
I would like to write a blog on this one.
This week I started off with Mastering Go by Mihalis Tsoukalos
I got to learn about many things this week but I would go on to mention only that I feel are worth sharing.
First, the file descriptors. These are integer representation of files that are open within a process (Like devices too coz everything is a file in Linux). Although this has many advantages in kernel’s perspective, I find the short hand it offers to describe a file. For example, look at this command
go run main.go >/tmp/output 2>&1
There are 3 file descriptors when a process starts
- 0 - Standard Input
- 1 - Standard Output
- 2 - Standard Error
By redirecting the output of main.go to /tmp/output, the standard output now points to /tmp/output. After this whenever you use 1 file descriptor, you are essentially using /tmp/output instead of whatever the standard output was initially.
Next, the garbage collection. In the book it was only about the Tricolor algorithm that Go uses. But my dumbass did not know about stack, heap and root objects. So I Chatgpt’ed my way to truly appreciating how the garbage collection saves my ass everyday.
As far as the algorithm goes, there would be three set or baskets (tricolor) - White, Grey and Black. Initially all the objects (in the context of garbage collection, we are solely taking about the heap memory objects) start in the white set. Now the algorithm starts with root objects (these are the objects that are accessible by the program - think global variables and so) and see if it points to any of the objects in white. If found, it would move it to grey. Grey is sort of like the work list, until all the children of the object is traversed, it stays in grey. Once it is done, it moves to black. At the end, the objects in white are the ones without references hence will be garbage collected.
Again, this is a great topic for writing a blog.
That is it for the week, in the week 41, I’m looking forward to learning more from Mastering Go.
Thank you very much for reading if you have made it this far 💛.