Skip to content

Better data structures for large record sets #17795

Description

@miodvallat
  • Program: Authoritative
  • Issue type: Feature request

Description

When dealing with zone records, the code in auth usually uses std::vector<DNSRecord> or std::vector<DNSResourceRecord>. This works well as most of the processing of these records are sequential processing and/or sequential construction of the container.

However, with zones containing huge number of records, the requirement for std::vector to be a contiguous container becomes a real problem, especially if its size (the number of records) is not known beforehand.

For better scalability, we need to switch to a smarter container, preserving the O(1) iteration and growth features of std::vector. Using std::list is not really an option as it would cause a lot of small memory allocation and a significant overhead due to the extra pointers chaining the elements.

Boost has boost::segtor which, if I understand correctly, behaves as a std::vector but allocated as a list of large vectors. It would be nice to try it and confirm that it does the job, with a low memory usage overhead.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions