Go 1.24 Swiss Map In and Out

Inside Go 1.24’s New Map Implementation: SIMD, XOR, and the Swiss Map Approach

Warm-up Time

  1. 🛠️ Struct Optimizations in Go — Go structs group multiple fields together, but how these fields are arranged can significantly impact performance. The article talks about the memory layout of structs and how to organize fields to minimize memory usage and improve CPU performance.

  2. 🔐 How To Implement JWT Authentication In Your Golang API — JWT defines a compact and self-contained way of securely transmitting information between parties as a JSON object, and it’s broadly used to handle authentication. This is a very good start to learning about JWT, claims, and how tokens are signed.

  3. 🤖 Evaluate LLM Apps in Go — When working with LLMs, you cannot easily test your app, as the outputs are non-deterministic. How do you test them? This is an introduction to a new testing approach/repo for evaluating responses based on how close they are to what is expected. Instead of TDD, for LLM-based apps, you now have EDD.
    P.S: Martin Fowler also recently published "Emerging Patterns in Building GenAI Products" which is kinda relevant.

  4. 🐞 Tips to Debug Hanging Go Programs — A very interesting write-up sharing practical tips for debugging Go programs. Three takeaways to expect: how to print and read stack traces, how to attach the Delve debugger, and how to use core dumps. I was on the edge about where to place this article, but I think these are things everyone should at least have heard of once.

  5. 🔄 Nil Channels in Go — If not careful, using select with a nil channel can lead to an infinite loop. There are also differences between a closed channel and a nil channel. This is a great article on how channels and select behave in different scenarios and how to write less error-prone code when using channels.

Tool Time

  1. 🌀 ondrajz/go-callvis —This tool provides developers with a visual overview of a Go program using data from the call graph and its relations with packages and types. This is handy when the complexity of the code is high, and you’re simply trying to understand code written by someone else.

  2. 🏃 valyala/fasthttp — A faster HTTP server implementation in Go. It’s supposed to be 10× faster compared to net/http due to several optimizations, including reusing request objects.

  3. 🌐 tetratelabs/wazero — A lightweight runtime that lets you run WebAssembly modules without any dependencies. So, you can easily extend your Go applications with code from other languages. Plus, it supports both an interpreter and a compiler for better performance.

  4. 🚀 michal-laskowski/wax — WAX is a Go library for server-side rendering (SSR) of JSX/TSX components, designed to provide a seamless, dynamic view layer without the need to regenerate templates after code changes.

  5. 🍃 jorgerojas26/lazysql — A handy cross-platform TUI database management tool built with Go. It aims to make working with databases easier, especially if you spend a lot of time in the terminal. It even supports Vim keybindings.

Social Media Marketing GIF by GrowthX

Advertisement

Start learning AI in 2025

Keeping up with AI is hard – we get it!

That’s why over 1M professionals read Superhuman AI to stay ahead.

  • Get daily AI news, tools, and tutorials

  • Learn new AI skills you can use at work in 3 mins a day

  • Become 10X more productive

Deep Dive

  1. 😱 The cost of Go’s panic and recover — In Go, you have two options for error handling: using panic/recover or returning errors. panic/recover comes with performance penalties, which Julien discusses in this post. However, that’s not the only reason I’m sharing this post—there are also great examples of using benchstat and gcflags, which can be helpful for performance improvements.

  2. 🛠️ Protobuf generators for fun and profitprotoc supports plugins, and developing one is not rocket science. This article walks through how to implement a protobuf plugin that generates output files tailored to your needs, such as Markdown documentation from .proto files.

  3. 🇨🇭 Swiss Maps in Go — FOSDEM’25 talks are now public, and there’s a great talk by Bryan about the internals of the new map implementation in Go 1.24. This is an in-depth talk where he walks through the clever approaches used to compare metadata.
    Spoiler alert: SIMD and an ingenious use of XOR to avoid looping.

    big bang theory sheldon GIF by CTV

    Fun Fact

    It’s called a Swiss Map because the abbreviation for Closed Hashing is CH, which is also Switzerland's country code. 😃

Reply

or to participate.