Performance check for Golang Switch/Map
How to run the present
-
Install the present tools from Golang
go install golang.org/x/tools/present
-
Start the present in the current directory
present
-
Open your browser and go to http://127.0.0.1:3999
How to generate different size of elements
$ cd plugs
$ ELEMENTS=<size-of-elements> make clean all
Note you might encounter into a problem when using a too large size for the elements.
How to check the performance?
$ cd internal/plugs
$ go test -v -bench=. -benchmem -benchtime 5s .
Next steps
- Disassemble the obj files
- See what's the hash function in Golang
- See switch optimization from Golang
- Check the implementation from Golang