changes['phases'] used to be a dictionary mapping revisions to
(old, new) tuples.contains tuples for the phase transitions, The encoding is highly redundant and eats ~40MBwhich
for the test case in issue5691. Recognize that for new,provides a non-trivial overhead in Python. only the threeReplace this with a Python
phases are valid and record the state using three sets. For old,dictionary containing 4 bit integers. keepProvide accessors to centralize
three sets for the changes['phases as well and encode unknown as lack of
membership in the three sets.'] procsessing in one place.
On average, Provide a helper function to enumerate thethis improves user time for issue5691 by 1% and peak RSS by