[PR #1787] [MERGED] NameIter use a u8 for start/end. #2606

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

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/1787
Author: @darnuria
Created: 10/5/2022
Status: Merged
Merged: 10/10/2022
Merged by: @bluejekyll

Base: mainHead: name-iterator/u8


📝 Commits (1)

  • ab68ccf NameIter use a u8 for start/end.

📊 Changes

1 file changed (+8 additions, -8 deletions)

View changed files

📝 crates/proto/src/rr/domain/name.rs (+8 -8)

📄 Description

Maybe it's totally stupid or silly, but since by definition domain name have a upper bound (see https://www.ietf.org/rfc/rfc1035.txt) we can leverage to reduce the size of LabelIter struct from 24 bytes to 16 bytes.

size of the struct obtained with std::mem::size_of::<LabelIter<'_>>()

I can make some analysis to show how much it's worth it if it's not "considered too stupid". ;)


🔄 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/1787 **Author:** [@darnuria](https://github.com/darnuria) **Created:** 10/5/2022 **Status:** ✅ Merged **Merged:** 10/10/2022 **Merged by:** [@bluejekyll](https://github.com/bluejekyll) **Base:** `main` ← **Head:** `name-iterator/u8` --- ### 📝 Commits (1) - [`ab68ccf`](https://github.com/hickory-dns/hickory-dns/commit/ab68ccf17a4be7ca2f6521bf17ad0eb069c75eea) NameIter use a u8 for start/end. ### 📊 Changes **1 file changed** (+8 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/proto/src/rr/domain/name.rs` (+8 -8) </details> ### 📄 Description Maybe it's totally stupid or silly, but since by definition domain name have a upper bound (see https://www.ietf.org/rfc/rfc1035.txt) we can leverage to reduce the size of `LabelIter` struct from 24 bytes to 16 bytes. size of the struct obtained with `std::mem::size_of::<LabelIter<'_>>()` I can make some analysis to show how much it's worth it if it's not "considered too stupid". ;) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 10:47:07 +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#2606
No description provided.