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 589
    • Issues 589
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 95
    • Merge requests 95
  • 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
  • !7045

Simplify and speed up DNS name decompression

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Tony Finch requested to merge 3655-decompress-faster into main Nov 07, 2022
  • Overview 34
  • Commits 4
  • Pipelines 30
  • Changes 59

The aim is to do less work per byte:

  • Check the bounds once then call isc_ascii_lowercopy() or memmove(), instead of checking the bounds for each character and copying each character one by one.

  • To remember where the name ends, we only need to update the end marker when we see a compression pointer or when we reach the root label. There is no need to check if we jumped back and conditionally update the counter for every byte.

  • To parse a compression pointer, we no longer take a diversion around the outer loop in between reading the upper byte of the pointer and the lower byte.

  • The parser state machine is now implicit in the instruction pointer, instead of being an explicit variable. Similarly, when we reach the root label we break directly out of the loop instead of setting a second state machine variable.

Closes #3655 (closed)

Edited Nov 10, 2022 by Tony Finch
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: 3655-decompress-faster