swiss icon indicating copy to clipboard operation
swiss copied to clipboard

how's the memory in bytes allocation? how much garbage does it generate?

Open hiqsociety opened this issue 2 years ago • 2 comments

how's the memory in bytes allocation? how much garbage does it generate?

hiqsociety avatar Mar 31 '23 20:03 hiqsociety

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:

memory-usage

andy-wm-arthur avatar Apr 02 '23 16:04 andy-wm-arthur

yes i already know about this graph but it doesnt shows

  1. bytes allocation / op
  2. memory usage after creation and deletion of maybe 1 mil items?
  3. gc "stop the world" pause when gc is done on 1 mil items stored?

hiqsociety avatar Apr 05 '23 19:04 hiqsociety