And "Suddenly", Everything Was Faster • The Applied Go Weekly Newsletter 2025-03-09
Your weekly source of Go news, tips, and projects
And "Suddenly", Everything Was Faster
Welcome back, !
I love success stories. Especially, if they are about software that got faster and used less memory after being ported to Go. But is it just a matter of language? Sure, Go outpaces other languages, particularly interpreted ones, by a fair margin in many benchmarks. Simple and straightforward by design, optimized over years (just look at the improvements to the garbage collector!), and reaping the performance and memory usage benefits of a compiled, statically typed, garbage-collected language, Go is the go-to language for boosting legacy software.
Yet, if I read success stories about software ports to Go, I often feel they read like, "we just rewrote everything in Go and suddenly, everything runs faster!" It's understandable that those success stories aren't always digging into the details, especially if they're just short posts on social media, but parts of the gains in speed, memory usage, or general efficiency aren't caused by just switching the language. If this was the case, everyone would write software in their favorite language, and automatic translators would turn the code into the best-performing language on Earth.
In this issue's Spotlight, I want to shed a light on another crucial factor besides the language itself.
Enjoy!
– Christoph
Featured articles
Beyond the Debugger: A Comprehensive Guide to Debugging Go Applications
There are myriads of bug types, in the world of insects as well as in the world of software. Squashing the latter requires experience, good tooling, and some best practices.
In this article (oh my, the first one after a too long pause), I list some fundamental debugging techniques, from precautionary measures to debugging with git bisect
.
Building a CLI Wrapper for Whisper: From Transcription to Distribution
Scratch your own itch: Akash Joshi found the whisper.cpp command a bit unwieldy, so he wrote a convenience wrapper in Go.
Remark 1: I already used better-whisper
to transcribe one of my course videos. If only my course hosting provider had an API to upload 100+ updated videos automatically. I'm definitely not looking forward to uploading each video through a slow UI.
Remark 2: This is the first guest post on AppliedGo.net! 🥳
The Repository pattern in Go: a painless way to simplify your service logic | Three Dots Labs blog
You cannot abstract away a database from your application entirely, but letting database logic creep into your application isn't a good thing, either. The repository pattern is a useful abstraction layer that translates business logic into database logic. Robert Laszczak explains how to implement this pattern in Go.
[security] Go 1.24.1 and Go 1.23.7 are released
Go 1.24.1 and 1.23.7 fix a security issue in net/http
, x/net/proxy
, and x/net/http/httpproxy
that allowed a proxy bypass using IPv6 zone IDs.
Download the updates at https://go.dev/dl/ or use your favorite package manager. For details, review the release notes.
Podcast corner
Fallthrough: Tools We Love
The Fallthrough panel shares 38 of their favorite tools, from Jujitsu to IKEA SKÅDIS. (Side note: Fallthrough is the successor of the ceased Go Time podcast.)
go podcast() 053: My exp w/ Gomponent in prod with Markus Wustenberg
This episode's guest is Markus Wüstenberg, author of Gomponent, a pure-Go HTML templating library. He talks about Gompoment with one of its users, podcast host Dominc St-Pierre.
Spotlight: Optimizing a codebase by porting it to Go?
We gophers love success stories of porting codebases to Go, don't we? Especially if the port results in massive speedups or dramatically reduced resource usage (usually it's both). Here's one such story:
My job has a Scala service that they've been optimizing and improving for about 5 years. We just finished rewriting it in Go. The new service uses ~10% of the old's memory, and about 50% cpu, under the same load. The codebase is also much simpler, the image size is ~40mb instead of 1gb, and the pods restart in about 2 seconds, as opposed to 30-ish. So like, great success.
This story got me thinking. Is it really that easy? Just re-write everything in Go and—poof!—instant success?
Of course not. But what else makes the difference? The above story contains a hint:
The codebase is also much simpler
Now we're talking. Mechanical porting wouldn't simplify the codebase. Apparently, the team took the occasion and not only ported the code but also transformed it from Scala-ish to Go-ish.
This, in turn, means that the team was aware of how Go works, and they knew how to adapt the code. In particular, to get substantial optimizations from a port to Go, a team would –
- Get rid of the idioms and paradigms of the legacy language
- Become familiar with Go's idioms and paradigms
- Embrace the Go community's best practices
Bottom line: If you plan to port legacy code to Go (let alone have an LLM port the code), keep in mind that a substantial part of the desired speedup or memory consumption reduction may come from adapting the code to the idioms, paradigms, and best practices of Go.
Quote of the week: What makes us human
As Buddha said, what makes us human is being able to click on the squares that contain traffic lights
More articles, videos, talks
The Go Blog: From unique to cleanups and weak: new low-level tools for efficiency
Go 1.24 had new features as diverse as a unique
package, the runtime.Cleanup()
function, and the weak.Pointer
type. However, although they seem completely unrelated to each other, they have one thing in common: They can make Go programs more efficient.
Minesweeper with Raylib Go Bindings
Bored? Play some minesweeper. Alex Pilutau built one with Go and Raylib, a C library for building videogames. Still bored? Read the article and build another game with Go and Raylib.
Coordinating Goroutine Listeners
Max Hoffman explores various methods for coordinating background worker threads, including duplicating work, spin-locking, using contexts, and implementing broadcasts with sync.Cond.
The cost of Go's panic and recover :: jub0bs.com
panic
and recover
operations are meant for handling exceptional situations that should remain rare. Consequently, the performance of panic
and recover
isn't an issue... unless they're improperly used to implement control flow. If you don't believe this is much of a problem, take a look at Julien Cretel's benchmarks.
Functional Options Pattern // André Santos
Go's functions don't support optional parameters. The next-best idiom for passing optional configuration to newly created objects is the Functional Options pattern. André Santos explains how they work.
Practical Protobuf - From Basic to Best Practices
Phuong Le continues the series on communication protocols with this article about protobuf types and how to optimize for size.
Building an IP Address Manager in Go
Virtual Private Clouds (VPCs) are isolated network segments that help organize and secure an IP infrastructure. Each VPC gets a range of IP addresses assigned, but as the number of reserved IPv4 addresses within a network is quite limited, address ranges need to be assigned to, and unassigned from, VPCs. That's what an IP address manager does. Mohamed Said wrote one and shares his building steps.
Go 1.24 remote caching explained
The standard caching mechanism of Go's toolchain is file-based. In some situations, such as CI pipelines, other caching mechanisms like in-memory would be a better choice. Go 1.24 allows to have an external program manage the caching. Chris Goller shares the performance improvements achieved by connecting the Go toolchain to their Depot Cache service and explains how the new GOCACHEPROG feature works.
Understanding Go’s Supercharged Map in v1.24
The map
became faster in Go 1.24. Chen "Devopsian" explores the internals of the new Swiss-Table-based algorithm.
Stacked middleware vs embedded delegation in Go
When your HTTP handler shall call multiple middleware functions, you'd typically stack them into a call chain. Middleware stacking, however, can become cumbersome to work with.
Redowan Delowar compares this classic approach to Gin's embedded delegation pattern and also explores a mix between the two.
Projects
Libraries
GitHub - lordaris/gotth-boilerplate: A minimal web application boilerplate using the GOTTH (golang, templ, tailwind, HTMX) stack:
Forget the GOTH stack, here comes GOTTH (golang, templ, tailwind, HTMX). Or, more precisely, Gochitemtaihposa (Go, Chi, Templ, Tailwind CSS, HTMX, PostgreSQL, Air). A boilerplate repo for quickly ramping up web app projects.
GitHub - ju4nv1e1r4/cost-llm-go
Fine-tuning a large language model can be costly, but with this library, your LLM-enabled Go app can estimate training and inference costs by the number of input tokens.
GitHub - firepear/petrel: Like SQLite, but for networking
If you wonder about the repo's tagline, "Like SQLite, but for networking", you're not alone. The readme resolves the riddle: "SQLite lets programmers add reliable, structured data storage to any program, with no hassle, low resource overhead, and no infrastructure requirements. Petrel aims to do the same for networking."
Tools and applications
GitHub - huangsam/namigo: Your naming pal, written in Go 🐶
Naming variables is one of the unsolved problems in IT. Naming projects is even harder due to external conditions such as domain availability. Not any more! Namigo searches for available names across your repos, in DNS, and in email(?).
GitHub - fira42073/trifsm: Mermaid diagrams to fsm
Are you frequently implementing finite state machines (FSMs) in Go? How about defining your FSMs as cool Mermaid diagrams instead of manually coding them? Just let trifsm
convert the diagram into Go code.
GitHub - darccio/diffty: Local Git Diff Visualization and Review Tracking Tool
Git diff visualization in the browser, with basic PR workflow support (approve, reject, skip).
GitHub - ad1822/containerGO: Container Runtime from scratch
Implementing this lightweight container runtime, the author learned a lot about mnamespace isolation, cgroups implementation, OverlayFS, system calls, the OCI standards, UnionFS, and more.
If you want to learn these things as well, maybe start by studying this project.
GitHub - yusuf-musleh/mmar: mmar is a zero-dependency, self-hostable, cross-platform HTTP tunnel that exposes your localhost to the world on a public URL. Written in Go.
mmar
is an HTTP tunneling tool that allows you to expose your localhost to the world on a public URL. It is written in pure Go with only the standard library.
GitHub - sairash/p2p_chat_app: Peer to Peer Chat Application made in golang
A networking learning project and the first stepping stone on the author's way of writing an IPFS-inspired distributed storage.
Completely unrelated to Go
Turing Machines
No matter how sophisticated your Go code is, it is equivalent to a Turing machine, the simplest representation of a computer but theoretically capable of everything a modern computer can do.
To give you an idea how simple the design of the Turing machine is: An infinite roll of toilet paper, an infinite supply of stones, and a written table with instructions to move to the previous or next toilet paper sheet, read the number of stones on the current sheet, and add or remove stones from the current sheet is all you need.
Ok, I get it, the "infinite" part makes it impractical to construct a Turing machine in the physical world. The next-best option: Enjoy Sam Rose's article with interactive Turing machine animations.
Making any integer with four 2s
Fun with math! For any given integer, can you construct a mathematical term that evaluates to this integer but contains only 2's (but any operations are allowed)?
Moreover, can you construct such a term with exactly four 2's?
And could there be a single formula that can generate all integers this way?
Ask Eli Bendersky.

Happy coding! ʕ◔ϖ◔ʔ
Questions or feedback? Drop me a line. I'd love to hear from you.
Best from Munich, Christoph
Not a subscriber yet?
If you read this newsletter issue online, or if someone forwarded the newsletter to you, subscribe for regular updates to get every new issue earlier than the online version, and more reliable than an occasional forwarding.
Find the subscription form at the end of this page.
How I can help
If you're looking for more useful content around Go, here are some ways I can help you become a better Gopher (or a Gopher at all):
On AppliedGo.net, I blog about Go projects, algorithms and data structures in Go, and other fun stuff.
Or visit the AppliedGo.com blog and learn about language specifics, Go updates, and programming-related stuff.
My AppliedGo YouTube channel hosts quick tip and crash course videos that help you get more productive and creative with Go.
Enroll in my Go course for developers that stands out for its intense use of animated graphics for explaining abstract concepts in an intuitive way. Numerous short and concise lectures allow you to schedule your learning flow as you like.
Christoph Berger IT Products and Services
Dachauer Straße 29
Bergkirchen
Germany