Search process of HiPAC High-Performance Rule Matching Algorithm
When I received an email, A friend thought I had misunderstood nf-HiPAC. How can such a high-performance algorithm be forced by traditional hash and tree algorithms. Yes, HiPAC is a very powerful algorithm, and there are few documents. This increases the mystery of HiPAC, but it does not mean that it is incomprehensible. On the contrary, it has a very simple idea.
Five rules are defined. Among them, Rule1 has the highest priority and Rule5 has the lowest priority, indicating that the bottom-to-top priority is gradually reduced. As shown in, the matching of each interval is as follows:
Range 1: Match Rule5;
If a match falls in the range of 5, which Rule does it match? In range 5, a line is run from bottom to top. The first line is Rule1. Because of its highest priority, Rule1 is matched. If a match falls into range 2, from bottom to top, it first runs through Rule3, so it matches Rule3; if a match falls into the range 1, it matches Rule5 because it only runs through Rule5; if it falls into the range 10, sorry, none of the rules are passed through, indicating that no rules are matched!