# Mapping Strings to Float Arrays in Go: How Fast Can We Go?

DevFeed: [Mapping Strings to Float Arrays in Go: How Fast Can We Go?](<https://devfeed.tech/articles/mapping-strings-to-float-arrays-in-go-how-fast-can-we-go-29404.md>)

Original publisher: [Read original article](<https://lemire.me/blog/2026/05/05/mapping-strings-to-float-arrays-in-go-how-fast-can-we-go/>)

Author: Daniel Lemire

Published: 2026-05-05T19:01:09Z

Content type: article

Language: en

Sources: [Daniel Lemire](<https://devfeed.tech/sources/daniel-lemire.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Benchmark](<https://devfeed.tech/topics/benchmark.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>), [floating-point](<https://devfeed.tech/topics/floating-point.md>)

Tags: [go](<https://devfeed.tech/tags/go.md>), [harness](<https://devfeed.tech/tags/harness.md>), [memory](<https://devfeed.tech/tags/memory.md>), [performance](<https://devfeed.tech/tags/performance.md>), [vectors](<https://devfeed.tech/tags/vectors.md>)

## AI overview

This article examines mapping strings to small float arrays in Go using the constmap library. It explains an immutable map based on a binary fuse filter and compares index-based and pointer-based value storage with a standard Go map. In the reported benchmark, the indexed constmap was twice as fast as the Go map, while raw pointers reduced lookup time further, with important garbage-collector and serialization limitations.

## Source excerpt

A common pattern in modern software is to map a string key to a small array of floating-point numbers. Word embeddings, feature vectors, lookup tables for physical constants: all variations on the same theme. In Go, the obvious way to write this is a map[string][]float32. But how fast is it, really, and can we do ... Continue reading Mapping Strings to Float Arrays in Go: How Fast Can We Go?