X XFediYour place in the Fediverse
XFEDI

Remote profile

ActivityPub
Profile banner

Tomasz Nurkiewicz

@[email protected]

Member of https://mastodon.social/@JavaChampions | 👨‍💻 Senior Engineering Tech Lead at monday.com | ✉️ nurkiewicz (at gmail) | Podcaster: 🔊 http://nurkiewicz.com

Open remote profile ↗
Posts

I just replaced `map` with a slice of KV pairs in #Go. Not only it's much less memory for less than 8 items, it's also much faster access, despite theoretical O(n).

Moreover, keys are not sorted in that slice. It turns out binary search is less efficient because less than/greater than comparison of strings is way more expensive than equality check

↩ Reply ♡ 0 · ↻ 0 ↗ Original