Just wanted to congratulate the Golang team for their effort in dramatically improving the performance of map lookups in this latest release.
I maintain a repo of Conways Game of Life in many different languages (GitHub - KieranP/Game-Of-Life-Implementations: Conway's Game of Life implementation in various languages). Every now and then I benchmark the latest versions.
Within my implementations, there is a function/method called “render”, which loops over rows (X) and columns (Y), fetches the value from the map for that given X/Y coord, and then concats to a string depending on the value.
In Go 1.23, this code at it’s quickest took 0.261ms per iteration, with the average being 0.278ms. It could complete 74324 iterations within 30 seconds, ranking it at 10th overall.
In Go 1.24, this code at it’s quickest now takes 0.185ms per iteration, with the average being 0.195ms (about 30% quicker). It now completes 97378 iterations within 30 seconds (about 24% more), putting it at 5th place.
This required no code changes, just update Go, recompile, and go.
Fantastic!