Enable or tweak the ruleset optimizer, possible values none, basic (default), profile
set ruleset-optimization basic
or
$ sudo pfctl -o basic
With the basic setting the optimizer
Removes duplicate rules
Removes rules that are subsets of other rules
Merges rules into tables if appropriate
Changes rules order to improve performance