Find duplicate pattern variables in a set of the bound names
Why
Each new pattern variable was compared with every variable the pattern had bound so far, and a let rec … and … group is one pattern, so n bindings cost O(n²) string comparisons: 16,000 bindings took 2.7 s. They now take 2.0 s.
The names are kept in a set next to the list of variables, in one value, so that resetting the pattern and the save and restore around or-patterns carry both.