swiss
swiss copied to clipboard
how's the memory in bytes allocation? how much garbage does it generate?
how's the memory in bytes allocation? how much garbage does it generate?
Hey @hiqsociety. SwissMap is designed to be memory efficient. It stores its elements using two backing slices and only makes allocations when resizing, so there is minimal garbage generated. It also has a higher load factor than the built-in Golang map, so its memory footprint is smaller. Here is a chart comparing the memory footprint of SwissMap to the built-in Golang map. The memory footprint of storing the same data in a slice is also included for comparison:

yes i already know about this graph but it doesnt shows
- bytes allocation / op
- memory usage after creation and deletion of maybe 1 mil items?
- gc "stop the world" pause when gc is done on 1 mil items stored?