[PR #1450] [MERGED] proto: improve label compression by adding targets to name_pointers #2326

Closed
opened 2026-03-16 08:47:51 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/1450
Author: @leshow
Created: 4/12/2021
Status: Merged
Merged: 4/25/2021
Merged by: @bluejekyll

Base: mainHead: fix_compression


📝 Commits (2)

  • 370b2bb proto: canonical names added to name_pointers
  • 7fd639d Merge branch 'main' into fix_compression

📊 Changes

2 files changed (+67 additions, -29 deletions)

View changed files

📝 crates/proto/src/rr/domain/name.rs (+19 -27)
📝 crates/proto/src/serialize/binary/encoder.rs (+48 -2)

📄 Description

RDATA using emit_as_canonical where canonical == true will have their labels written to name_pointers. This improves compression in cases where some records may have labels identical to the target in the RDATA of other records.

with_canonical_names is called in a bunch of places https://github.com/bluejekyll/trust-dns/blob/main/crates/proto/src/rr/record_data.rs#L870 Maybe some of these we really don't want to store in name_pointers? If so, perhaps another condition is in order here.

The test suite passes and I've added a test that verifies this case of compression, it relies on the final length of the buffer so it is a bit sensitive to any other changes which could affect that, however I'm not sure how else to test this.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/1450 **Author:** [@leshow](https://github.com/leshow) **Created:** 4/12/2021 **Status:** ✅ Merged **Merged:** 4/25/2021 **Merged by:** [@bluejekyll](https://github.com/bluejekyll) **Base:** `main` ← **Head:** `fix_compression` --- ### 📝 Commits (2) - [`370b2bb`](https://github.com/hickory-dns/hickory-dns/commit/370b2bb46ecb3284c47c5ab1899b581e9bd31681) proto: canonical names added to name_pointers - [`7fd639d`](https://github.com/hickory-dns/hickory-dns/commit/7fd639daba0e1c55005a3b55cb8070f6ccdd1d2f) Merge branch 'main' into fix_compression ### 📊 Changes **2 files changed** (+67 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `crates/proto/src/rr/domain/name.rs` (+19 -27) 📝 `crates/proto/src/serialize/binary/encoder.rs` (+48 -2) </details> ### 📄 Description RDATA using `emit_as_canonical` where `canonical == true` will have their labels written to `name_pointers`. This improves compression in cases where some records may have labels identical to the target in the RDATA of other records. `with_canonical_names` is called in a bunch of places https://github.com/bluejekyll/trust-dns/blob/main/crates/proto/src/rr/record_data.rs#L870 Maybe some of these we really don't want to store in `name_pointers`? If so, perhaps another condition is in order here. The test suite passes and I've added a test that verifies this case of compression, it relies on the final length of the buffer so it is a bit sensitive to any other changes which could affect that, however I'm not sure how else to test this. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 08:47:51 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#2326
No description provided.