2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-02 07:35:26 +00:00

preen data structure survey

Tony Finch
2022-03-30 11:11:41 +01:00
parent 652b8beb5a
commit 802227a044

@@ -28,58 +28,59 @@ disclaimers
----------- -----------
My personal interest is the work I have done over the last several My personal interest is the work I have done over the last several
years on my "[qp-trie][]" data structure, and the variants that have years on my "[qp-trie][]" data structure, and the qp-trie variants
been tuned to work well with DNS names as keys, and for copy-on-write that have been tuned to work well with DNS names as keys, and for
concurrency. I prototyped these variants in [my fork of NSD][], copy-on-write concurrency. I prototyped these variants in [my fork of
because it is simpler than BIND, and it already has a choice between a NSD][], because it is simpler than BIND, and it already has a choice
red-black tree and a radix tree, so adding a qp-trie was not too hard. between a red-black tree and a radix tree, so adding a qp-trie was not
too hard.
[qp-trie]: https://dotat.at/prog/qp [qp-trie]: https://dotat.at/prog/qp
[my fork of NSD]: QPtrie-in-NSD [my fork of NSD]: QPtrie-in-NSD
I am writing these notes as myself because they are primarily a I am writing these notes with a personal point of view because they
learning exercise for myself, though I hope they might also be useful are primarily a learning exercise for myself, though I hope they might
to others. It is easier not to worry about mistakes or inaccuracies if also be useful to others. (It is easier not to worry about mistakes or
I am not trying to present this as the consensus of the BIND inaccuracies if I am not trying to present this as the consensus of
developers. And there is a date at the top because there's a fair the BIND developers.) And there is a date at the top because there's a
chance this will become a historical document rather than being fair chance this will become a historical document rather than being
maintained as a current one. maintained as a current one.
# `lib/isc/astack` # `isc/astack`
Fixed-size array stack Fixed-size array stack
## used by ## used by
* `lib/isc/netmgr/netmgr` * `isc/netmgr/netmgr`
# `lib/isc/heap` # `isc/heap`
Priority queue Priority queue
## used by ## used by
* `lib/dns/rbtdb` * `dns/rbtdb`
* `lib/dns/zoneverify` * `dns/zoneverify`
* `lib/isc/timer` * `isc/timer`
## notes ## notes
No locking / single-threaded. No locking / single-threaded.
# `lib/isc/ht` # `isc/ht`
Hash table Hash table
## used by ## used by
* `bin/plugins/filter-a` and `bin/plugins/filter-aaaa` * `bin/plugins/filter-a` and `bin/plugins/filter-aaaa`
* `lib/dns/catz` (which leaks into `bin/named/server`) * `dns/catz` (which leaks into `bin/named/server`)
* `lib/dns/rpz` * `dns/rpz`
* `lib/isc/tls` * `isc/tls`
## notes ## notes
@@ -89,14 +90,14 @@ Uses chaining, so it is heavy on indirection and heavy on allocation.
Modern hash tables use open addressing. Modern hash tables use open addressing.
# `lib/isc/radix` # `isc/radix`
Radix tree for IP address prefix matching Radix tree for IP address prefix matching
## used by ## used by
* `lib/dns/acl` * `dns/acl`
* `lib/dns/iptable` * `dns/iptable`
## notes ## notes