- 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.
Description
When dealing with zone records, the code in auth usually uses
std::vector<DNSRecord>orstd::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::vectorto 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. Usingstd::listis 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::segtorwhich, if I understand correctly, behaves as astd::vectorbut 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.