Skip to content
/ go-map Public

the Go's hashmap implementation using pure Go with generics

License

Notifications You must be signed in to change notification settings

w1kend/go-map

Repository files navigation

go-map

Go's 1.19 hashmap implementation using pure Go with generics.

About

This is Go's 1.19 map implementation written with pure Go. Using this repo you can learn how maps work in Go internally and undestand the main concept of a hashmap in general. This repo uses algorithms from an actual map implementation under the Go's hood, except some things due to better undestanding.

This code was written additionaly to my article on Habr, where I've desribed maps internals - what is a hashmap, main terms, concepts, difference with Python and Java.

Here you can find some kind of auto-generated English translation.

You can also use this repo as a start point to improve/change a base implementation that we have in Go 1.19.

Contributions

Any contributions are welcome. Don't hesitate creating PRs to improve similarity to a base implementation, to fix bugs, typos, redability etc.

Links

Articles\videos which will help you to delve into a hashmap:

Go:
GopherCon 2016: Keith Randall - Inside the Map Implementation
How the Go runtime implements maps efficiently (without generics)
Hacking Go's Runtime with Generics

Python:
Raymond Hettinger Modern Python Dictionaries A confluence of a dozen great ideas PyCon 2017
Raymond Hettinger.More compact dictionaries with faster iteration

Java:
The Java HashMap Under the Hood
Liner probing lecture. cs166 stanford
An Analysis of Hash Map Implementations in Popular Languages

About

the Go's hashmap implementation using pure Go with generics

Resources

License

Stars

Watchers

Forks

Packages

No packages published