[PR #311] [MERGED] minor optimizations for deserialization #1360

Closed
opened 2026-03-16 02:02:09 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/311
Author: @little-dude
Created: 12/6/2017
Status: Merged
Merged: 12/7/2017
Merged by: @bluejekyll

Base: masterHead: encoding


📝 Commits (3)

  • 1094db9 add benchmarks for (de)serialization
  • 278d095 deserialization: read entire slices when possible
  • 50b03e1 serialization optimizations:

📊 Changes

6 files changed (+172 additions, -82 deletions)

View changed files

📝 Cargo.lock (+1 -0)
📝 proto/Cargo.toml (+2 -1)
proto/benches/lib.rs (+128 -0)
📝 proto/src/lib.rs (+1 -0)
📝 proto/src/serialize/binary/decoder.rs (+4 -26)
📝 proto/src/serialize/binary/encoder.rs (+36 -55)

📄 Description

I added some benchmarks to quantify the win (pretty minor, but a win is a win :p)
Before:

test bench_parse_header  ... bench:         145 ns/iter (+/- 1)
test bench_parse_message ... bench:         926 ns/iter (+/- 67)

After:

test bench_parse_header  ... bench:         117 ns/iter (+/- 0) 
test bench_parse_message ... bench:         816 ns/iter (+/- 11)

I've experimented with more ambitious changes but it was not conclusive.


🔄 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/311 **Author:** [@little-dude](https://github.com/little-dude) **Created:** 12/6/2017 **Status:** ✅ Merged **Merged:** 12/7/2017 **Merged by:** [@bluejekyll](https://github.com/bluejekyll) **Base:** `master` ← **Head:** `encoding` --- ### 📝 Commits (3) - [`1094db9`](https://github.com/hickory-dns/hickory-dns/commit/1094db91d89cbce2b671e6ad8cf16063c0b277a1) add benchmarks for (de)serialization - [`278d095`](https://github.com/hickory-dns/hickory-dns/commit/278d0957c1b6d98a58a8caeba2170d521e7ee128) deserialization: read entire slices when possible - [`50b03e1`](https://github.com/hickory-dns/hickory-dns/commit/50b03e10048dfcd2de2cb8aceaded6150f4ed340) serialization optimizations: ### 📊 Changes **6 files changed** (+172 additions, -82 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+1 -0) 📝 `proto/Cargo.toml` (+2 -1) ➕ `proto/benches/lib.rs` (+128 -0) 📝 `proto/src/lib.rs` (+1 -0) 📝 `proto/src/serialize/binary/decoder.rs` (+4 -26) 📝 `proto/src/serialize/binary/encoder.rs` (+36 -55) </details> ### 📄 Description I added some benchmarks to quantify the win (pretty minor, but a win is a win :p) Before: ``` test bench_parse_header ... bench: 145 ns/iter (+/- 1) test bench_parse_message ... bench: 926 ns/iter (+/- 67) ``` After: ``` test bench_parse_header ... bench: 117 ns/iter (+/- 0) test bench_parse_message ... bench: 816 ns/iter (+/- 11) ``` I've [experimented](https://github.com/little-dude/trust-dns/tree/byteorder) with more ambitious changes but it was not conclusive. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 02:02:09 +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#1360
No description provided.