I just noticed that in the next release of NSD, there will be a
build-time option called "disable-radix-tree". The accompanying comment
says that it uses a red-black tree instead, and lowers memory usage.
However, this isn't a default option, so my assumption is that this has
other negative side effects, but there's no mention of such effects.
Could you please tell us more about this? Are lookups in red-black trees
slower? Do they use more CPU? Is there any other reason why you don't
use a red-black tree by default?
I just noticed that in the next release of NSD, there will be a
build-time option called "disable-radix-tree". The accompanying comment
says that it uses a red-black tree instead, and lowers memory usage.
However, this isn't a default option, so my assumption is that this has
other negative side effects, but there's no mention of such effects.
Could you please tell us more about this? Are lookups in red-black trees
slower? Do they use more CPU? Is there any other reason why you don't
use a red-black tree by default?
A small speed difference. It is a memory-for-speed tradeoff, and the
benefits are about 10% either way. If memory is an obstacle; 10% speed
hopefully isn't. Otherwise, upgrade the machine, I guess...
Could you please tell us more about this? Are lookups in
red-black trees slower? Do they use more CPU? Is there any other
reason why you don't use a red-black tree by default?
A small speed difference. It is a memory-for-speed tradeoff, and
the benefits are about 10% either way. If memory is an obstacle;
10% speed hopefully isn't. Otherwise, upgrade the machine, I
guess...
Thanks for this explanation. We have enough memory on our servers, so
I don't foresee the need to disable the radix tree.
Do you mind appending "but uses some more CPU" to the help string of
the disable-radix-tree option? This will make the consequences of this
option completely clear.
Could you please tell us more about this? Are lookups in
red-black trees slower? Do they use more CPU? Is there any other
reason why you don't use a red-black tree by default?
A small speed difference. It is a memory-for-speed tradeoff, and
the benefits are about 10% either way. If memory is an obstacle;
10% speed hopefully isn't. Otherwise, upgrade the machine, I
guess...
Thanks for this explanation. We have enough memory on our servers, so
I don't foresee the need to disable the radix tree.
Do you mind appending "but uses some more CPU" to the help string of
the disable-radix-tree option? This will make the consequences of this
option completely clear.
Yes, done that! This is the tree for the main lookup (for David:) that
looks for the answer to the query. NSD also uses (various) data
structures for other purposes (including radix and red-black trees) and
those are not changed by the option.