kazu-yamamoto / dnsext

Extensible DNS libraries written purely in Haskell
59 stars 3 forks source link

improving key tag #148

Closed kazu-yamamoto closed 1 year ago

kazu-yamamoto commented 1 year ago

Two optimization:

  1. The size of loop is now half
  2. Magic hash is used since worker-wrapper does not work
Before:
keyTagFromBS.go                       DNS.SEC.Verify.Verify     DNS/SEC/Verify/Verify.hs:(46,5)-(53,22)         3.4    8.3

After:
keyTagFromBS.loop                     DNS.SEC.Verify.Verify     DNS/SEC/Verify/Verify.hs:(52,5)-(66,32)         1.8    4.9
kazu-yamamoto commented 1 year ago

@khibino Could you improve this code with readWord8OffAddr#?

kazu-yamamoto commented 1 year ago

keyTagFromBS is invisible in profile. Great! Let's merge this.