Gregory Wright wrote:


Hi,


I have a question of style and efficiency. If I use a table with a single element, say

table <multicast> const { 224/8 }

Is it significant more expensive to in a rule than an explicit (or macro expanded)
224/8?

Probably something like 5x-10x slower.


I understand the advantages of the table, especially as I begin to make exceptions
for specific multicast addresses. But is there any reason to avoid singleton tables?
Or any stylistic reason to favor them over macros?

I'm using singleton tables when:
1) I want to add/remove rules without reloading the ruleset
2) I want to benefit from the extra statistics available with table entries.
I cannot see any other reason to use that.


I would assume that there would be some overhead when calling the radix
tree code to match the table entry. Is it small enough to be negligible?

Testing a table (with one or a few addresses) should be, as a guess, 5x-10x slower than just testing one address in a direct rule. Now I would bet that unless you've a very high traffic FW or a very slow machine, it will be negligible. Cedric



Reply via email to