Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hiqsociety opened this issue Mar 31, 2023 · 2 comments

Comments

@hiqsociety
Copy link

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

@andy-wm-arthur
Copy link
Contributor

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

@hiqsociety
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants