I've changed data structure for named index because of performance reasons. build_named_index/2 was super slow for a zone with thousands of records. Here is a small performance test:
$ ./run.sh
> rr("include/erldns.hrl").
> R = #dns_rr{name = <<"s">>, type = 1, ttl = 3600, data = #dns_rrdata_a{ip = {127, 0, 0, 1}}}.
> RR = [ R#dns_rr{name = <<(integer_to_binary(N))/binary, ".p">>} || N <- lists:seq(0, 1000000)].
> Zone = {<<"test">>, <<>>, RR, []}.
> timer:tc(fun () -> erldns_zone_cache:put_zone(Zone) end).
I've got 12 minutes for master branch and 11 seconds for my version.
I've changed data structure for named index because of performance reasons.
build_named_index/2
was super slow for a zone with thousands of records. Here is a small performance test:I've got 12 minutes for master branch and 11 seconds for my version.