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

dnsdist: Reorganize the IDState and Rings fields #10381

Merged
merged 2 commits into from
May 19, 2021

Conversation

rgacogne
Copy link
Member

Short description

Reducing the space lost to padding and thus the memory usage. This change saves 1 MB of memory per downstream server in the default configuration, and around 8 bytes per entry in the ring buffer. It also adds a few words about memory consumption in the documentation.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

Reducing the space lost to padding and thus the memory usage. This
change saves 1 MB of memory per downstream server in the default
configuration, and around 8 bytes per entry in the ring buffer.
Copy link
Member

@omoerbeek omoerbeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this! Do you use a tool to help you get the sizes and alignments? If so, I like to know how. I would use in gdb ptype /o IDState

@rgacogne
Copy link
Member Author

Do you use a tool to help you get the sizes and alignments? If so, I like to know how. I would use in gdb ptype /o IDState

Unfortunately I don't. I was doing it by looking at the structs in gdb but your exact way is much better! Thanks :)

@rgacogne rgacogne merged commit 8a8dc12 into PowerDNS:master May 19, 2021
@rgacogne rgacogne deleted the ddist-better-padding branch May 19, 2021 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants