<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Plan on Miek Gieben</title>
    <link>https://miek.nl/tags/plan/</link>
    <description>Recent content in Plan on Miek Gieben</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <copyright>© Copyright 2007-2024 Miek Gieben</copyright>
    <lastBuildDate>Fri, 15 Jul 2022 11:59:24 +0000</lastBuildDate>
    <atom:link href="https://miek.nl/tags/plan/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>A miekg/dns v2 package?</title>
      <link>https://miek.nl/2022/july/15/a-miekg/dns-v2-package/</link>
      <pubDate>Fri, 15 Jul 2022 11:59:24 +0000</pubDate>
      <guid>https://miek.nl/2022/july/15/a-miekg/dns-v2-package/</guid>
      <description>&lt;p&gt;A DNS v2 library exists at &lt;a href=&#34;https://codeberg.org/miekg/dns&#34;&gt;https://codeberg.org/miekg/dns&lt;/a&gt;. And it&amp;rsquo;s fucking fast, &lt;s&gt;360K&lt;/s&gt; 410K qps with&#xA;UDP (on arm64) machines.&lt;/p&gt;&#xA;&lt;p&gt;It:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Still uses Go structs (the naive thing I tested with a 100% binary format was dog slow), so no builder&#xA;method.&lt;/li&gt;&#xA;&lt;li&gt;Does the header/rdata split in RRs, with an rdata sub-package that contains the rdata. This solves the&#xA;&lt;code&gt;CopyWith&lt;/code&gt; and &lt;code&gt;CopyWithout&lt;/code&gt; alluded below.&lt;/li&gt;&#xA;&lt;li&gt;EDNS0 pseudo records are now also RRs.&lt;/li&gt;&#xA;&lt;li&gt;Contains a Data &lt;code&gt;[]byte&lt;/code&gt; slice in Msg, to &lt;em&gt;do&lt;/em&gt; reference wire-format.&lt;/li&gt;&#xA;&lt;li&gt;Many, many, ease of use functions and sub packages, such as &lt;code&gt;dnstest&lt;/code&gt;, &lt;code&gt;dnsutil&lt;/code&gt;, &lt;code&gt;dnsconf&lt;/code&gt;, etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;While browsing, I stumbled upon &lt;a href=&#34;https://pkg.go.dev/golang.org/x/net/dns/dnsmessage#Builder&#34;&gt;https://pkg.go.dev/golang.org/x/net/dns/dnsmessage#Builder&lt;/a&gt; and I&#xA;can see that is a way quicker way to create a DNS message. This made me think about a miekg/dns.v2&#xA;package again and what that should fix. I think it&amp;rsquo;s indeed better to just retain the wire format at&#xA;all times as this is faster - although just working with a Go struct is very much a joy. Also begs&#xA;the question: &amp;ldquo;Is it really that slow?&amp;rdquo; (compression on large messages is slow, memory use will def.&#xA;be higher in current miekg/dns).&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
