Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • BIND BIND
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 592
    • Issues 592
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 100
    • Merge requests 100
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • BINDBIND
  • Merge requests
  • !7280

Stream DNS: try to handle incoming data directly - avoid memory copying/buffer resizing when reading data

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Artem Boldariev requested to merge artem-streamdns-avoid-copying-on-reading into main Dec 29, 2022
  • Overview 15
  • Commits 1
  • Pipelines 7
  • Changes 1

This commit optimises isc_dnsstream_assembler_t in such a way that memory copying and reallocation are avoided when receiving one or more complete DNS messages at once. We try to handle the data from the messages directly, without storing them in an intermediate memory buffer.

In particular, the following cases are optimised:

  • There is no data in the internal buffer - try to handle incoming messages directly, avoiding copying memory if possible;
  • There is partial message available in the internal buffer - try to copy enough data into the buffer to handle it, then try to handle the rest directly, without copying.

N.B.

The fact that similar optimisations are possible was mentioned in the comments in old transports superseded by StreamDNS. However, due to the way how they were structured, it was rather hard to implement that. Having a separate entity dedicated for handling incoming DNS messages makes is easier.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: artem-streamdns-avoid-copying-on-reading