• Miek Gieben's avatar
    cache: some optimizations (#2247) · e6d02a3f
    Miek Gieben authored
    Remove some optimization and lowercasing of the qname (in the end
    miekg/dns should provide a fast and OK function for it).
    
    * remove the make([]byte, 2) allocation in the key()
    * use already lowercased qname in hash key calculation.
    
    % benchcmp old.txt new.txt
    benchmark                    old ns/op     new ns/op     delta
    BenchmarkCacheResponse-4     9599          8735          -9.00%
    Signed-off-by: default avatarMiek Gieben <miek@miek.nl>
    e6d02a3f
cache_test.go 8.15 KB