Exploring Go 1.24: What’s New and Why It Matters

A Preview of Go 1.24 Innovations

Stefanie Lai
3 min readJan 6, 2025
AI generated

Go 1.24 has been finished and is ready to be launched in Feb. 2025. As usual, let’s take a quick preview of its new features.

Compiler

There are three optimizations in the complier.

The most important one lies in the underlying map implementation, which saves memory overhead by 2–3% and improves read and write efficiency by switching to languages like Rust to implement swisstable hash data structure. To know more about it, please turn to the proposal runtime: use SwissTable.

The second optimization is spin mutex, which reduces the thread switching overhead by adding a spinning state to the thread.

The last one enables GC to handle pointers more flexibly by adding AddCleanup function to the pointer type.

Standard Library

Compared with previous versions, not many generics-related language features are added in version 1.24, which only officially introduces the experimental feature slice type alias of 1.23 and expands the scope of the original type alias with type SliceExp[T any] []T.

type S= SliceExp[string] 
var s S
fmt.Println(len(s))

--

--

Stefanie Lai
Stefanie Lai

Responses (2)