Replace skip step calculation so it scales O(n) instead of O(n*n). Loading large rulesets consists of two phases. First, the rules are parsed and added, one by one, to the inactive ruleset. The machine remains responsive during that phase. Then, the new ruleset is activated, and the skip steps are calculated. The machine locks up during that phase. This second phase is greatly reduced with the new algorithm. With the old one, calculation could take 30s for 12k rules, with the new one, 100k rules take less than 1s. For small rulesets (less than 1000 rules), the gain is insignificant.
Replace skip step calculation so it scales O(n) instead of O(n*n).
Loading large rulesets consists of two phases. First, the rules are
parsed and added, one by one, to the inactive ruleset. The machine
remains responsive during that phase. Then, the new ruleset is
activated, and the skip steps are calculated. The machine locks up
during that phase. This second phase is greatly reduced with the new
algorithm. With the old one, calculation could take 30s for 12k rules,
with the new one, 100k rules take less than 1s. For small rulesets
(less than 1000 rules), the gain is insignificant.

ok mcbride@, henning@

orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars